mirror of
https://github.com/NaN-tic/trytond-patches.git
synced 2023-12-14 06:03:03 +01:00
17 lines
800 B
Diff
17 lines
800 B
Diff
# http://codereview.tryton.org/5871002/
|
|
|
|
diff -r 46c9a4316548 sale.py
|
|
--- .a/trytond/trytond/modules/sale/sale.py Thu Dec 04 23:41:16 2014 +0100
|
|
+++ .b/trytond/trytond/modules/sale/sale.py Wed Dec 17 21:27:11 2014 +0100
|
|
@@ -1365,8 +1369,10 @@
|
|
if old_invoice_line.type != 'line':
|
|
continue
|
|
if old_invoice_line.id not in skip_ids:
|
|
+ sign = (1.0 if invoice_type == old_invoice_line.invoice_type
|
|
+ else -1.0)
|
|
quantity -= Uom.compute_qty(old_invoice_line.unit,
|
|
- old_invoice_line.quantity, self.unit)
|
|
+ sign * old_invoice_line.quantity, self.unit)
|
|
|
|
rounding = self.unit.rounding if self.unit else 0.01
|
|
invoice_line.quantity = Uom.round(quantity, rounding)
|