From 09ed7c56809d6898f52d164d87189ca77053c385 Mon Sep 17 00:00:00 2001 From: Bertrand Chenal Date: Tue, 27 Jan 2009 17:48:42 +0100 Subject: [PATCH] Use bool to evaluate fields on readonly condition --- packing.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packing.py b/packing.py index 09742190b0..568ce0e56e 100644 --- a/packing.py +++ b/packing.py @@ -48,7 +48,7 @@ class PackingIn(OSV): "]", states={ 'readonly': "state in ('received', 'done', 'cancel') "\ - "or not warehouse", + "or not bool(warehouse)", }, context="{'warehouse': warehouse, 'type': 'incoming'," \ "'supplier': supplier}") inventory_moves = fields.Function('get_inventory_moves', type='one2many', @@ -472,7 +472,7 @@ class PackingOut(OSV): relation='stock.move', string='Outgoing Moves', fnct_inv='set_outgoing_moves', states={ - 'readonly':"state != 'draft' or not warehouse", + 'readonly':"state != 'draft' or not bool(warehouse)", }, context="{'warehouse': warehouse, 'type': 'outgoing'," \ "'customer': customer}") inventory_moves = fields.Function('get_inventory_moves', type='one2many',