From aeadbc05d1dca741a49c2a71220f19cbbc8cd159 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Sat, 13 Sep 2014 15:25:04 +0200 Subject: [PATCH] Re-use on_change_with_amount in get_amount issue4167 review5591002 --- purchase.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/purchase.py b/purchase.py index a9b9ec52fe..fc7a5915a2 100644 --- a/purchase.py +++ b/purchase.py @@ -1176,8 +1176,7 @@ class PurchaseLine(ModelSQL, ModelView): def get_amount(self, name): if self.type == 'line': - return self.purchase.currency.round( - Decimal(str(self.quantity)) * self.unit_price) + return self.on_change_with_amount() elif self.type == 'subtotal': amount = Decimal('0.0') for line2 in self.purchase.lines: