mirror of
https://github.com/OCA/contract.git
synced 2025-02-13 17:57:24 +02:00
[FIX] product_contract_variable_quantity: use property_contract_template_id
This commit is contained in:
committed by
Pedro M. Baeza
parent
500461396b
commit
90f2f3b3f6
@@ -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
|
||||
|
||||
@@ -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',
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user