From 3dda1e5ab045a0c0b12cbdbb6ecfc464a78035c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Wed, 28 Mar 2012 18:00:35 +0200 Subject: [PATCH] Fix moves states for customer shipment - outgoing moves should be editable in assigned - inventory moves should be readonly in cancel review310003 --- shipment.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/shipment.py b/shipment.py index fcea4fc982..c1efb5615e 100644 --- a/shipment.py +++ b/shipment.py @@ -760,7 +760,7 @@ class ShipmentOut(Workflow, ModelSQL, ModelView): ('company', '=', Eval('company')), ], states={ - 'readonly': ((Eval('state') != 'draft') + 'readonly': ((Eval('state').in_(['waiting', 'done', 'cancel'])) | ~Eval('warehouse') | ~Eval('customer')), }, depends=['state', 'warehouse', 'customer', 'warehouse_output', @@ -775,7 +775,8 @@ class ShipmentOut(Workflow, ModelSQL, ModelView): ('company', '=', Eval('company')), ], states={ - 'readonly': Eval('state').in_(['draft', 'packed', 'done']), + 'readonly': Eval('state').in_( + ['draft', 'packed', 'done', 'cancel']), }, depends=['state', 'warehouse', 'warehouse_storage', 'warehouse_output', 'company']),