changeset b5a041f67cd5 in modules/stock:5.8
details: https://hg.tryton.org/modules/stock?cmd=changeset&node=b5a041f67cd5
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
        (grafted from 7695afdfb9ce5ab8ef49993ec8311a557e555647)
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 244cb0d30749 -r b5a041f67cd5 shipment.py
--- a/shipment.py       Thu Aug 05 23:47:09 2021 +0200
+++ b/shipment.py       Thu Aug 12 18:45:25 2021 +0200
@@ -973,6 +973,7 @@
                 ('waiting', 'assigned'),
                 ('waiting', 'picked'),
                 ('assigned', 'picked'),
+                ('waiting', 'packed'),
                 ('picked', 'packed'),
                 ('packed', 'done'),
                 ('assigned', 'waiting'),
@@ -1010,16 +1011,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 244cb0d30749 -r b5a041f67cd5 
tests/scenario_stock_shipment_out_same_storage_output.rst
--- a/tests/scenario_stock_shipment_out_same_storage_output.rst Thu Aug 05 
23:47:09 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