Do not use sale return lines for computation

issue7160
review41131002
This commit is contained in:
Cédric Krier committed 2018-02-28 18:59:34 +01:00
1 parent 969f655262
commit c36116c1f6
1 file changed
+2 -3
+2 -3
View File
@@ -22,10 +22,9 @@ class Sale:
amount = 0
for line in self.lines or []:
if (getattr(line, 'unit_price', None)
and getattr(line, 'quantity', None)
and (getattr(line, 'quantity') or 0) > 0
and not getattr(line, 'shipment_cost', None)):
amount += (line.unit_price
* Decimal(str(line.quantity or 0)))
amount += line.unit_price * Decimal(str(line.quantity))
context['amount'] = amount
context['currency'] = self.currency.id
return context