Do not use sale return lines for computation
issue7160 review41131002
This commit is contained in:
1 parent
969f655262
commit
c36116c1f6
1 file changed
+2
-3
@@ -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
|
||||
Reference in new issue
Block a user