diff --git a/product_contract_variable_quantity/models/product_template.py b/product_contract_variable_quantity/models/product_template.py index a99ae9aaf..d4152d206 100644 --- a/product_contract_variable_quantity/models/product_template.py +++ b/product_contract_variable_quantity/models/product_template.py @@ -25,8 +25,6 @@ class ProductTemplate(models.Model): """ Clear the relation to contract_template_id when downgrading product from contract """ - res = super(ProductTemplate, self)._change_is_contract() if not self.is_contract: self.qty_type = False self.qty_formula_id = False - return res diff --git a/product_contract_variable_quantity/tests/test_sale_order.py b/product_contract_variable_quantity/tests/test_sale_order.py index a80332c91..b820f1c96 100644 --- a/product_contract_variable_quantity/tests/test_sale_order.py +++ b/product_contract_variable_quantity/tests/test_sale_order.py @@ -26,11 +26,12 @@ class TestSaleOrder(TransactionCase): 'result = 12', } ) - self.product1.write( + self.product1.with_context( + force_company=self.sale.company_id.id).write( { 'is_contract': True, 'default_qty': 12, - 'contract_template_id': self.contract_template1.id, + 'property_contract_template_id': self.contract_template1.id, 'qty_formula_id': self.formula.id, 'qty_type': 'variable', }