changeset ecc41bf57f90 in trytond:default
details: https://hg.tryton.org/trytond?cmd=changeset;node=ecc41bf57f90
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
diffstat:

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

diffs (12 lines):

diff -r 071a8b02e436 -r ecc41bf57f90 trytond/model/model.py
--- a/trytond/model/model.py    Mon Sep 30 09:40:36 2019 +0200
+++ b/trytond/model/model.py    Tue Oct 08 18:10:23 2019 +0200
@@ -184,7 +184,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