Use bool to evaluate fields on readonly condition

This commit is contained in:
Bertrand Chenal committed 2009-01-27 17:48:42 +01:00
1 parent 6e3a9479f4
commit 09ed7c5680
1 file changed
+2 -2
+2 -2
View File
@@ -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',