mirror of
https://github.com/NaN-tic/trytond-patches.git
synced 2023-12-14 06:03:03 +01:00
Change diff fix_rounding_in_sync_inventory_to_outgoing for 4.0 series
This commit is contained in:
parent
4f146226e5
commit
6a452319f9
|
@ -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:56:24 2015 +0200
|
||||
@@ -119,16 +119,19 @@
|
||||
diff -r 463332839c4e trytond/trytond/modules/stock_lot/stock.py
|
||||
--- a/trytond/trytond/modules/stock_lot/stock.py Wed May 11 11:26:49 2016 +0200
|
||||
+++ b/trytond/trytond/modules/stock_lot/stock.py Mon May 30 14:50:17 2016 +0200
|
||||
@@ -120,16 +120,19 @@
|
||||
round=False)
|
||||
if quantity < out_quantity:
|
||||
outgoing_moves.extend(Move.copy([out_move], default={
|
||||
|
@ -24,26 +24,26 @@ diff -r fdfe606e6b87 stock.py
|
|||
|
||||
|
||||
class ShipmentOutReturn:
|
||||
diff -r 519c1c1a1ca2 shipment.py
|
||||
--- a/trytond/trytond/modules/stock/shipment.py Mon Oct 05 12:22:18 2015 +0200
|
||||
+++ b/trytond/trytond/modules/stock/shipment.py Mon Oct 05 12:23:46 2015 +0200
|
||||
@@ -1177,14 +1177,17 @@
|
||||
diff -r 95ad0421e638 trytond/trytond/modules/stock/shipment.py
|
||||
--- a/trytond/trytond/modules/stock/shipment.py Wed May 11 11:24:37 2016 +0200
|
||||
+++ b/trytond/trytond/modules/stock/shipment.py Mon May 30 14:51:55 2016 +0200
|
||||
@@ -1205,6 +1205,8 @@
|
||||
for move in shipment.outgoing_moves:
|
||||
if move.state == 'cancel':
|
||||
continue
|
||||
key = cls._sync_inventory_to_outgoing_grouping_key(move,
|
||||
'outgoing')
|
||||
- if outgoing_qty.get(key, 0.0) > 0.0:
|
||||
+ if (outgoing_qty.get(key, 0.0)
|
||||
+ if (outgoing_qty.get(move.product.id, 0.0)
|
||||
+ > move.product.default_uom.rounding):
|
||||
if outgoing_qty.get(move.product.id, 0.0) > 0.0:
|
||||
exc_qty = Uom.compute_qty(move.product.default_uom,
|
||||
outgoing_qty[key], move.uom)
|
||||
removed_qty = Uom.compute_qty(move.uom,
|
||||
min(exc_qty, move.quantity), move.product.default_uom,
|
||||
outgoing_qty[move.product.id], move.uom)
|
||||
@@ -1213,7 +1215,9 @@
|
||||
round=False)
|
||||
Move.write([move], {
|
||||
- 'quantity': max(0.0, move.quantity - exc_qty),
|
||||
if write:
|
||||
Move.write([move], {
|
||||
- 'quantity': max(0.0, move.quantity - exc_qty),
|
||||
+ 'quantity': max(0.0, Uom.round(
|
||||
+ move.quantity - exc_qty,
|
||||
+ move.uom.rounding)),
|
||||
})
|
||||
outgoing_qty[key] -= removed_qty
|
||||
})
|
||||
outgoing_qty[move.product.id] -= removed_qty
|
||||
|
||||
|
|
Loading…
Reference in a new issue