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:
+3
-2
@@ -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']),
|
||||
|
||||
Reference in New Issue
Block a user