changeset 7695afdfb9ce in modules/stock:default
details: https://hg.tryton.org/modules/stock?cmd=changeset&node=7695afdfb9ce
description:
        Allow to skip picking if output is the storage location

        The picked step is pointless in such case because there is no inventory 
moves.
        Also we must allow to fill packages in waiting.

        issue10620
        review363611002
diffstat:

 shipment.py                                               |  19 +++++++++-----
 tests/scenario_stock_shipment_out_same_storage_output.rst |   6 +---
 2 files changed, 14 insertions(+), 11 deletions(-)

diffs (55 lines):

diff -r f93388b04d34 -r 7695afdfb9ce shipment.py
--- a/shipment.py       Fri Aug 06 09:41:00 2021 +0200
+++ b/shipment.py       Thu Aug 12 18:45:25 2021 +0200
@@ -1054,6 +1054,7 @@
                 ('waiting', 'assigned'),
                 ('waiting', 'picked'),
                 ('assigned', 'picked'),
+                ('waiting', 'packed'),
                 ('picked', 'packed'),
                 ('packed', 'done'),
                 ('assigned', 'waiting'),
@@ -1091,16 +1092,20 @@
                     'depends': ['state'],
                     },
                 'pick': {
-                    'invisible': If(Eval('warehouse_storage')
-                        == Eval('warehouse_output'),
-                        ~Eval('state').in_(['assigned', 'waiting']),
+                    'invisible': If(
+                        Eval('warehouse_storage') == Eval('warehouse_output'),
+                        True,
                         Eval('state') != 'assigned'),
-                    'depends': ['state', 'warehouse_storage',
-                        'warehouse_output'],
+                    'depends': [
+                        'state', 'warehouse_storage', 'warehouse_output'],
                     },
                 'pack': {
-                    'invisible': Eval('state') != 'picked',
-                    'depends': ['state'],
+                    'invisible': If(
+                        Eval('warehouse_storage') == Eval('warehouse_output'),
+                        Eval('state') != 'waiting',
+                        Eval('state') != 'picked'),
+                    'depends': [
+                        'state', 'warehouse_storage', 'warehouse_output'],
                     },
                 'done': {
                     'invisible': Eval('state') != 'packed',
diff -r f93388b04d34 -r 7695afdfb9ce 
tests/scenario_stock_shipment_out_same_storage_output.rst
--- a/tests/scenario_stock_shipment_out_same_storage_output.rst Fri Aug 06 
09:41:00 2021 +0200
+++ b/tests/scenario_stock_shipment_out_same_storage_output.rst Thu Aug 12 
18:45:25 2021 +0200
@@ -79,10 +79,8 @@
     >>> len(shipment_out.inventory_moves)
     0
 
-Assign the shipment::
-    >>> shipment_out.click('pick')
-    >>> shipment_out.state
-    'picked'
+Pack the shipment::
+
     >>> shipment_out.click('pack')
     >>> shipment_out.state
     'packed'

Reply via email to