Test key 'states' before use it for issue123

This commit is contained in:
Cédric Krier committed 2008-06-14 19:09:11 +02:00
1 parent 24d32d5da1
commit 3f75d1b100
1 file changed
+2 -1
+2 -1
View File
@@ -1755,7 +1755,8 @@ class ORM(object):
res[field][arg] = getattr(self._columns[field], arg)
if not write_access:
res[field]['readonly'] = True
if 'readonly' in res[field]['states']:
if res[field].get('states') and \
'readonly' in res[field]['states']:
res[field]['states'] = res[field]['states'].copy()
del res[field]['states']['readonly']
for arg in ('digits', 'invisible'):