changeset 8db9d17e567e in modules/stock:default
details: https://hg.tryton.org/modules/stock?cmd=changeset;node=8db9d17e567e
description:
        Fill planned date for inventory move

        Shipments that create inventory moves should fill a planned date for 
them as we
        have a method to compute it. The probability is high to inventory the 
product
        once received.

        issue9043
        review272871002
diffstat:

 shipment.py |  10 ++++------
 1 files changed, 4 insertions(+), 6 deletions(-)

diffs (41 lines):

diff -r e44ecccbff35 -r 8db9d17e567e shipment.py
--- a/shipment.py       Sun Mar 01 16:12:40 2020 +0100
+++ b/shipment.py       Fri Mar 06 23:53:19 2020 +0100
@@ -377,6 +377,7 @@
         'Return inventory move for the incoming move'
         pool = Pool()
         Move = pool.get('stock.move')
+        Date = pool.get('ir.date')
         if incoming_move.quantity <= 0.0:
             return None
         move = Move()
@@ -386,9 +387,7 @@
         move.from_location = incoming_move.to_location
         move.to_location = self.warehouse_storage
         move.state = Move.default_state()
-        # Product will be considered in stock only when the inventory
-        # move will be made:
-        move.planned_date = None
+        move.planned_date = max(self._move_planned_date[1], Date.today())
         move.company = incoming_move.company
         move.origin = incoming_move
         return move
@@ -1716,6 +1715,7 @@
         'Return inventory move for the incoming move'
         pool = Pool()
         Move = pool.get('stock.move')
+        Date = pool.get('ir.date')
         if incoming_move.quantity <= 0.0:
             return
         move = Move()
@@ -1725,9 +1725,7 @@
         move.from_location = incoming_move.to_location
         move.to_location = self.warehouse_storage
         move.state = Move.default_state()
-        # Product will be considered in stock only when the inventory
-        # move will be made:
-        move.planned_date = None
+        move.planned_date = max(self._get_move_planned_date[1], Date.today())
         move.company = incoming_move.company
         move.origin = incoming_move
         return move

Reply via email to