From 90f2f3b3f6a79fd89f2f0952ba54ebb04d5b1287 Mon Sep 17 00:00:00 2001 From: Ernesto Tejeda Date: Tue, 25 Feb 2020 23:05:31 -0500 Subject: [PATCH] [FIX] product_contract_variable_quantity: use property_contract_template_id --- .../models/product_template.py | 2 -- product_contract_variable_quantity/tests/test_sale_order.py | 5 +++-- 2 files changed, 3 insertions(+), 4 deletions(-) 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', }