trytond-patches/issue19491002_1.diff

41 lines
1.6 KiB
Diff

diff -r dba965a72938 sale.py
--- a/trytond/trytond/modules/sale/sale.py Tue Oct 06 10:07:07 2015 +0200
+++ b/trytond/trytond/modules/sale/sale.py Tue Oct 06 10:09:08 2015 +0200
@@ -1132,7 +1132,6 @@
return 2
def get_move_done(self, name):
- Uom = Pool().get('product.uom')
done = True
if not self.product:
return True
@@ -1146,7 +1145,7 @@
and move.id not in skip_ids:
done = False
break
- quantity -= Uom.compute_qty(move.uom, move.quantity, self.unit)
+ quantity -= move.origin_quantity
if done:
if quantity > 0.0:
done = False
@@ -1356,8 +1355,7 @@
quantity = 0.0
for move in self.moves:
if move.state == 'done':
- quantity += Uom.compute_qty(move.uom, move.quantity,
- self.unit)
+ quantity += move.origin_quantity
if move.invoiced_quantity < move.quantity:
stock_moves.append(move)
if self.sale.shipment_method == 'order':
@@ -1371,8 +1369,7 @@
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,
- sign * old_invoice_line.quantity, self.unit)
+ quantity -= sign * old_invoice_line.origin_quantity
rounding = self.unit.rounding if self.unit else 0.01
invoice_line.quantity = Uom.round(quantity, rounding)