changeset 98cc5724a13a in tryton:default
details: https://hg.tryton.org/tryton?cmd=changeset&node=98cc5724a13a
description:
        Do not rely on depends to select the fields to read in form view

        issue11134
        review389681019
diffstat:

 tryton/gui/window/view_form/view/form.py |  11 ++++-------
 1 files changed, 4 insertions(+), 7 deletions(-)

diffs (21 lines):

diff -r 8d573f681193 -r 98cc5724a13a tryton/gui/window/view_form/view/form.py
--- a/tryton/gui/window/view_form/view/form.py  Sun Jan 30 13:10:57 2022 +0100
+++ b/tryton/gui/window/view_form/view/form.py  Mon Jan 31 22:25:58 2022 +0100
@@ -516,13 +516,10 @@
         if record:
             # Force to set fields in record
             # Get first the lazy one from the view to reduce number of requests
-            field_names = set()
-            for name in self.widgets:
-                field = record.group.fields[name]
-                field_names.add(name)
-                field_names.update(f for f in field.attrs.get('depends', [])
-                    if (not f.startswith('_parent')
-                        and f in record.group.fields))
+            field_names = set(self.get_fields())
+            for name, field in record.group.fields.items():
+                if self.view_id in field.views:
+                    field_names.add(name)
             fields = []
             for name in field_names:
                 field = record.group.fields[name]

Reply via email to