[FIX] product_contract_variable_quantity: use property_contract_template_id

This commit is contained in:
Ernesto Tejeda
2020-02-25 23:05:31 -05:00
committed by Pedro M. Baeza
parent 500461396b
commit 90f2f3b3f6
2 changed files with 3 additions and 4 deletions

View File

@@ -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

View File

@@ -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',
}