From 9ea9bc77ed40ade8170322c3e5f10e5eb5ca00b0 Mon Sep 17 00:00:00 2001 From: Bertrand Chenal Date: Tue, 22 Apr 2008 00:54:50 +0200 Subject: [PATCH] Fix readonly contitions --- packing.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packing.py b/packing.py index 8317faced2..fcc8b89979 100644 --- a/packing.py +++ b/packing.py @@ -20,10 +20,11 @@ class PackingIn(OSV): 'stock.warehouse',"Warehouse", required=True, states=STATES,) incoming_moves = fields.One2Many( 'stock.move', 'incoming_packing_in', 'Incoming Moves', - states=STATES, + states={'readonly':"state in ('received','done')",}, context="{'wh_incoming': warehouse, 'pack_incoming_state': state}") inventory_moves = fields.One2Many( 'stock.move', 'inventory_packing_in', 'Inventory Moves', + states={'readonly':"state in ('draft','waiting')",}, context="{'wh_inv_in': warehouse, 'pack_inv_in_state': state}") code = fields.Char("Code", size=None, select=1, readonly=True,) state = fields.Selection( @@ -148,6 +149,7 @@ class PackingOut(OSV): context="{'wh_outgoing': warehouse, 'pack_outgoing_state': state}") inventory_moves = fields.One2Many( 'stock.move', 'inventory_packing_out', 'Inventory Moves', + states={'readonly':"state not in ('assigned')",}, context="{'wh_inv_out': warehouse, 'pack_inv_out_state': state}") code = fields.Char("Code", size=None, select=1, readonly=True,) state = fields.Selection(