diff --git a/rma_sale/wizards/rma_add_sale.py b/rma_sale/wizards/rma_add_sale.py index c2a4ecc3..44700e4e 100644 --- a/rma_sale/wizards/rma_add_sale.py +++ b/rma_sale/wizards/rma_add_sale.py @@ -175,7 +175,12 @@ class RmaAddSale(models.TransientModel): if line not in existing_sale_lines or tracking_move: if not tracking_move: data = self._prepare_rma_line_from_sale_order_line(line) - rma_line_obj.create(data) + rec = rma_line_obj.create(data) + # Ensure that configuration on the operation is applied + # TODO MIG: in v16 the usage of such onchange can be removed in + # favor of (pre)computed stored editable fields for all policies + # and configuration in the RMA operation. + rec._onchange_operation_id() else: for lot in line.mapped("move_ids.move_line_ids.lot_id").filtered( lambda x: x.id in self.lot_ids.ids @@ -183,7 +188,12 @@ class RmaAddSale(models.TransientModel): if lot.id in self.rma_id.rma_line_ids.mapped("lot_id").ids: continue data = self._prepare_rma_line_from_sale_order_line(line, lot) - rma_line_obj.create(data) + rec = rma_line_obj.create(data) + # Ensure that configuration on the operation is applied + # TODO MIG: in v16 the usage of such onchange can be removed in + # favor of (pre)computed stored editable fields for all policies + # and configuration in the RMA operation. + rec._onchange_operation_id() rma = self.rma_id data_rma = self._get_rma_data() rma.write(data_rma)