mirror of
https://github.com/NaN-tic/trytond-patches.git
synced 2023-12-14 06:03:03 +01:00
41 lines
1.6 KiB
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
|
|
@@ -1118,7 +1118,6 @@
|
|
return 2
|
|
|
|
def get_move_done(self, name):
|
|
- Uom = Pool().get('product.uom')
|
|
done = True
|
|
if not self.product:
|
|
return True
|
|
@@ -1132,7 +1131,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
|
|
@@ -1344,8 +1343,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':
|
|
@@ -1363,9 +1361,7 @@
|
|
old_invoice_type = old_invoice_line.invoice_type
|
|
|
|
sign = 1 if old_invoice_type == invoice_type else -1
|
|
-
|
|
- 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)
|