From b13f0e29df5f1affce5b67f75982569339a9ec60 Mon Sep 17 00:00:00 2001 From: sbejaoui Date: Thu, 29 Nov 2018 12:06:02 +0100 Subject: [PATCH] [FIX] - fix onchange --- .../models/sale_order_line.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/product_contract_variable_quantity/models/sale_order_line.py b/product_contract_variable_quantity/models/sale_order_line.py index bb58b397..63d0c89c 100644 --- a/product_contract_variable_quantity/models/sale_order_line.py +++ b/product_contract_variable_quantity/models/sale_order_line.py @@ -26,9 +26,10 @@ class SaleOrderLine(models.Model): @api.onchange('product_id') def onchange_product(self): super(SaleOrderLine, self).onchange_product() - if self.product_id.is_contract: - self.qty_type = self.product_id.qty_type - self.qty_formula_id = self.product_id.qty_formula_id + for rec in self: + if rec.product_id.is_contract: + rec.qty_type = rec.product_id.qty_type + rec.qty_formula_id = rec.product_id.qty_formula_id @api.multi def _prepare_contract_line_values(self, contract):