Call super on change product and quantity

This commit is contained in:
resteve 2014-09-09 16:18:10 +02:00
parent 73862b1c42
commit 5d7affdd61
1 changed files with 6 additions and 6 deletions

View File

@ -101,28 +101,28 @@ class SaleCart(ModelSQL, ModelView):
@fields.depends('product', 'unit', 'quantity', 'party', 'currency')
def on_change_product(self):
Line = Pool().get('sale.line')
line = Line()
SaleLine = Pool().get('sale.line')
line = SaleLine()
line.sale = None
line.party = self.party or None
line.product = self.product
line.unit = self.product and self.product.sale_uom.id or None
line.quantity = self.quantity or 0
line.description = None
return line.on_change_product()
return super(SaleLine, line).on_change_product()
@fields.depends('product', 'quantity', 'unit', 'currency', 'party')
def on_change_quantity(self):
if not self.product:
return {}
Line = Pool().get('sale.line')
line = Line()
SaleLine = Pool().get('sale.line')
line = SaleLine()
line.sale = None
line.party = self.party or None
line.product = self.product
line.unit = self.product.sale_uom.id
line.quantity = self.quantity or 0
return line.on_change_quantity()
return super(SaleLine, line).on_change_quantity()
@fields.depends('currency')
def on_change_with_currency_digits(self, name=None):