changeset e4a532dba812 in tryton:default
details: https://hg.tryton.org/tryton?cmd=changeset&node=e4a532dba812
description:
        Use dictionary as domain for Reference field

        issue11074
        review383911002
diffstat:

 tryton/gui/window/view_form/model/field.py |  10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

diffs (20 lines):

diff -r cf4a8197a493 -r e4a532dba812 tryton/gui/window/view_form/model/field.py
--- a/tryton/gui/window/view_form/model/field.py        Thu Feb 03 22:30:14 
2022 +0100
+++ b/tryton/gui/window/view_form/model/field.py        Thu Feb 03 23:05:47 
2022 +0100
@@ -952,6 +952,16 @@
         screen_domain, attr_domain = self.domains_get(record, pre_validate)
         return screen_domain
 
+    def domains_get(self, record, pre_validate=None):
+        if record.value.get(self.name):
+            model = record.value[self.name][0]
+        else:
+            model = None
+        screen_domain, attr_domain = super().domains_get(
+            record, pre_validate=pre_validate)
+        attr_domain = attr_domain.get(model, [])
+        return screen_domain, attr_domain
+
     def domain_get(self, record):
         if record.value.get(self.name):
             model = record.value[self.name][0]

Reply via email to