From 237f5cadbea8b61d56eeedda7ebcd725a41aaf6c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Thu, 12 Jun 2008 15:25:35 +0200 Subject: [PATCH] Don't empty states for readonly record, just remove 'readonly' attributes --- trytond/osv/orm.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/trytond/osv/orm.py b/trytond/osv/orm.py index 5ee00adc98..4e00efb083 100644 --- a/trytond/osv/orm.py +++ b/trytond/osv/orm.py @@ -1755,7 +1755,9 @@ class ORM(object): res[field][arg] = getattr(self._columns[field], arg) if not write_access: res[field]['readonly'] = True - res[field]['states'] = {} + if 'readonly' in res[field]['states']: + res[field]['states'] = res[field]['states'].copy() + del res[field]['states']['readonly'] for arg in ('digits', 'invisible'): if hasattr(self._columns[field], arg) \ and getattr(self._columns[field], arg):