trytond-patches/stock_lot_improve_sync_inve...

29 lines
1.5 KiB
Diff

diff -r 973556094501 stock.py
--- a/trytond/trytond/modules/stock_lot/stock.py Mon Oct 26 13:23:09 2015 +0100
+++ b/trytond/trytond/modules/stock_lot/stock.py Mon Oct 26 13:45:41 2015 +0100
@@ -133,19 +133,17 @@
out_quantity = Uom.compute_qty(out_move.uom,
out_move.quantity, out_move.product.default_uom,
round=False)
+ out_move_vals = {}
if quantity < out_quantity:
outgoing_moves.extend(Move.copy([out_move], default={
'quantity': Uom.round(
out_quantity - quantity,
out_move.uom.rounding),
}))
- Move.write([out_move], {
- 'quantity': Uom.round(
- quantity, out_move.uom.rounding),
- })
- Move.write([out_move], {
- 'lot': move.lot.id,
- })
+ out_move_vals['quantity'] = Uom.round(quantity,
+ out_move.uom.rounding)
+ out_move_vals['lot'] = move.lot.id
+ Move.write([out_move], out_move_vals)
quantity -= out_quantity
assert quantity <= move.product.default_uom.rounding