changeset 5ccf51289d50 in modules/stock:default
details: https://hg.tryton.org/modules/stock?cmd=changeset;node=5ccf51289d50
description:
        Filter empty date when computing maximum planned date

        and properly call _get_move_planned_date.

        issue9141
        review303061002
diffstat:

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

diffs (23 lines):

diff -r 8db9d17e567e -r 5ccf51289d50 shipment.py
--- a/shipment.py       Fri Mar 06 23:53:19 2020 +0100
+++ b/shipment.py       Tue Mar 17 20:06:43 2020 +0100
@@ -387,7 +387,8 @@
         move.from_location = incoming_move.to_location
         move.to_location = self.warehouse_storage
         move.state = Move.default_state()
-        move.planned_date = max(self._move_planned_date[1], Date.today())
+        move.planned_date = max(
+            filter(None, [self._move_planned_date[1], Date.today()]))
         move.company = incoming_move.company
         move.origin = incoming_move
         return move
@@ -1725,7 +1726,8 @@
         move.from_location = incoming_move.to_location
         move.to_location = self.warehouse_storage
         move.state = Move.default_state()
-        move.planned_date = max(self._get_move_planned_date[1], Date.today())
+        move.planned_date = max(
+            filter(None, [self._get_move_planned_date()[1], Date.today()]))
         move.company = incoming_move.company
         move.origin = incoming_move
         return move

Reply via email to