changeset f72a2a0086fc in trytond:default
details: https://hg.tryton.org/trytond?cmd=changeset&node=f72a2a0086fc
description:
        Do not get domain from empty reference field

        issue11074
diffstat:

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

diffs (16 lines):

diff -r 28604d09b40a -r f72a2a0086fc trytond/model/modelstorage.py
--- a/trytond/model/modelstorage.py     Thu Feb 03 23:13:28 2022 +0100
+++ b/trytond/model/modelstorage.py     Thu Feb 03 23:21:03 2022 +0100
@@ -1196,7 +1196,11 @@
                     domain = _record_eval_pyson(
                         record, pyson_domain, encoded=True)
                     if isinstance(domain, dict):
-                        domain = domain.get(get_relation(record).__name__, [])
+                        relation = get_relation(record)
+                        if relation:
+                            domain = domain.get(relation.__name__, [])
+                        else:
+                            domain = []
                     domain = freeze(domain)
                     context = freeze(_record_eval_pyson(
                             record, pyson_context, encoded=True))

Reply via email to