changeset 9c2781afb59f in trytond:5.6
details: https://hg.tryton.org/trytond?cmd=changeset;node=9c2781afb59f
description:
        Evaluate PYSON domain with the origin record

        When a relation domain is not valid, the domain used to set on the 
exception
        must be evaluated with the origin record and not the invalid target 
record.
        We take the first origin record as any of the passed record will 
generate the
        same domain per design.

        issue9383
        review317531002
        (grafted from 728cb4a36144e9f3225e2ff916c132ce82a1f8a7)
diffstat:

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

diffs (13 lines):

diff -r 91fc148afa7a -r 9c2781afb59f trytond/model/modelstorage.py
--- a/trytond/model/modelstorage.py     Tue Jun 16 19:11:24 2020 +0200
+++ b/trytond/model/modelstorage.py     Fri Jun 12 12:36:47 2020 +0200
@@ -1136,8 +1136,7 @@
                         invalid_record = invalid_records.pop()
                         domain = field.domain
                         if is_pyson(domain):
-                            domain = _record_eval_pyson(
-                                invalid_record, domain)
+                            domain = _record_eval_pyson(records[0], domain)
                         msg = gettext(
                             'ir.msg_domain_validation_record',
                             **cls.__names__(field.name))

Reply via email to