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)

--HG--
branch : 6.0
This commit is contained in:
Cédric Krier committed 2021-08-12 18:45:25 +02:00
1 parent d87b62932a
commit 10fbce941a
2 files changed
+14 -11

No files matched your search

+12 -7
View File
@@ -1054,6 +1054,7 @@ class ShipmentOut(ShipmentAssignMixin, Workflow, ModelSQL, ModelView):
('waiting', 'assigned'),
('waiting', 'picked'),
('assigned', 'picked'),
('waiting', 'packed'),
('picked', 'packed'),
('packed', 'done'),
('assigned', 'waiting'),
@@ -1091,16 +1092,20 @@ class ShipmentOut(ShipmentAssignMixin, Workflow, ModelSQL, ModelView):
'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',
@@ -79,10 +79,8 @@ Set the shipment state to waiting::
>>> 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'