Improve patch to fix rounding in inventory_to_outgoing

This commit is contained in:
Guillem Barba 2015-10-05 11:58:46 +02:00
parent d84c599795
commit 28b4efb8ab
1 changed files with 15 additions and 3 deletions

View File

@ -1,7 +1,7 @@
diff -r fdfe606e6b87 stock.py
--- a/trytond/trytond/modules/stock_lot/stock.py Thu Feb 19 00:04:21 2015 +0100
+++ b/trytond/trytond/modules/stock_lot/stock.py Mon Oct 05 11:26:49 2015 +0200
@@ -119,7 +119,9 @@
+++ b/trytond/trytond/modules/stock_lot/stock.py Mon Oct 05 11:56:24 2015 +0200
@@ -119,16 +119,19 @@
round=False)
if quantity < out_quantity:
outgoing_moves.extend(Move.copy([out_move], default={
@ -11,4 +11,16 @@ diff -r fdfe606e6b87 stock.py
+ out_move.uom.rounding),
}))
Move.write([out_move], {
'quantity': quantity,
- 'quantity': quantity,
+ 'quantity': Uom.round(
+ quantity, out_move.uom.rounding),
})
Move.write([out_move], {
'lot': move.lot.id,
})
quantity -= out_quantity
- assert quantity <= 0
+ assert quantity <= move.product.default_uom.rounding
class ShipmentOutReturn: