fix stock_lot sync_outgoing function to prevent on infinity loop

This commit is contained in:
?ngel ?lvarez 2019-12-11 11:41:58 +01:00
parent 350d68fab0
commit 04762aa5ee
1 changed files with 6 additions and 6 deletions

View File

@ -1,7 +1,7 @@
diff -r 039880e76024 /trytond/trytond/modules/stock_lotstock.py
--- a/trytond/trytond/modules/stock_lot/stock.py Thu Nov 21 10:40:39 2019 +0100
+++ b/trytond/trytond/modules/stock_lot/stock.py Thu Nov 21 11:33:55 2019 +0100
@@ -184,33 +184,76 @@
diff -r 5db7e45454ad stock.py
--- a/trytond/trytond/modules/stock_lot/stock.py Wed Dec 11 11:35:56 2019 +0100
+++ b/trytond/trytond/modules/stock_lot/stock.py Wed Dec 11 11:38:40 2019 +0100
@@ -184,33 +184,75 @@
shipments, create=create, write=write)
to_write = []
for shipment in shipments:
@ -65,8 +65,7 @@ diff -r 039880e76024 /trytond/trytond/modules/stock_lotstock.py
+ pending_qty = 0
+ to_write.extend( ([out_move], {'lot': move.lot}) )
+ outgoing_by_product[key].append((out_move, pending_qty))
+ quantity -= out_quantity
+ assert move.uom.round(quantity) <= 0
+ quantity = pending_qty
+
+ for values in outgoing_by_product.values():
+ for move, qty in values:
@ -104,3 +103,4 @@ diff -r 039880e76024 /trytond/trytond/modules/stock_lotstock.py
+
if to_write:
Move.write(*to_write)