changeset 2cb1ab25c17c in modules/stock:6.0
details: https://hg.tryton.org/modules/stock?cmd=changeset&node=2cb1ab25c17c
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 03608a4640bb -r 2cb1ab25c17c shipment.py
--- a/shipment.py Thu Aug 19 23:21:05 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 03608a4640bb -r 2cb1ab25c17c
tests/scenario_stock_shipment_out_same_storage_output.rst
--- a/tests/scenario_stock_shipment_out_same_storage_output.rst Thu Aug 19
23:21:05 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'