fix pylint

This commit is contained in:
sbejaoui
2019-09-30 14:25:09 +02:00
parent 7dd9ab32f1
commit 70b09b1e4c
2 changed files with 4 additions and 2 deletions

View File

@@ -25,7 +25,8 @@ class ProductTemplate(models.Model):
""" Clear the relation to contract_template_id when downgrading
product from contract
"""
super(ProductTemplate, self)._change_is_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

@@ -25,11 +25,12 @@ class SaleOrderLine(models.Model):
@api.onchange('product_id')
def onchange_product(self):
super(SaleOrderLine, self).onchange_product()
res = super(SaleOrderLine, self).onchange_product()
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
return res
@api.multi
def _prepare_contract_line_values(