changeset b66927c39bfd in trytond:5.2
details: https://hg.tryton.org/trytond?cmd=changeset;node=b66927c39bfd
description:
        Correctly test field access to set readonly attribute

        Since r 1094d993d89c, field variable is the field instance and no more 
the
        field name.

        issue8692
        review276071002
        (grafted from ecc41bf57f909f07e27461b176566af2b70fccc7)
diffstat:

 trytond/model/model.py |  2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diffs (12 lines):

diff -r 9b67a6fb35c2 -r b66927c39bfd trytond/model/model.py
--- a/trytond/model/model.py    Sun Oct 06 13:45:55 2019 +0200
+++ b/trytond/model/model.py    Tue Oct 08 18:10:23 2019 +0200
@@ -181,7 +181,7 @@
             if fields_names and fname not in fields_names:
                 continue
             definition[fname] = field.definition(cls, language)
-            if not accesses.get(field, {}).get('write', True):
+            if not accesses.get(fname, {}).get('write', True):
                 definition[fname]['readonly'] = True
                 states = decoder.decode(definition[fname]['states'])
                 states.pop('readonly', None)

Reply via email to