Browse Source

fix pylint

pull/265/head
sbejaoui 5 years ago
parent
commit
70b09b1e4c
  1. 3
      product_contract_variable_quantity/models/product_template.py
  2. 3
      product_contract_variable_quantity/models/sale_order_line.py

3
product_contract_variable_quantity/models/product_template.py

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

3
product_contract_variable_quantity/models/sale_order_line.py

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

Loading…
Cancel
Save