Make outgoing moves readonly on packed and inventory on asssigned

We should forbid to create new moves on those states because they will make the
state inconsistent.

issue6156
review32931002
This commit is contained in:
Cédric Krier
2017-01-13 20:06:42 +01:00
parent 7bc2bf1496
commit 09b756f0b0
+3 -2
View File
@@ -856,7 +856,8 @@ class ShipmentOut(Workflow, ModelSQL, ModelView):
('company', '=', Eval('company')),
],
states={
'readonly': ((Eval('state').in_(['waiting', 'done', 'cancel']))
'readonly': ((Eval('state').in_(
['waiting', 'packed', 'done', 'cancel']))
| ~Eval('warehouse') | ~Eval('customer')),
},
depends=['state', 'warehouse', 'customer', 'warehouse_output',
@@ -872,7 +873,7 @@ class ShipmentOut(Workflow, ModelSQL, ModelView):
],
states={
'readonly': Eval('state').in_(
['draft', 'packed', 'done', 'cancel']),
['draft', 'assigned', 'packed', 'done', 'cancel']),
},
depends=['state', 'warehouse', 'warehouse_storage',
'warehouse_output', 'company']),