changeset 34ef08b33f84 in trytond:5.4
details: https://hg.tryton.org/trytond?cmd=changeset;node=34ef08b33f84
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 6fcec78d6655 -r 34ef08b33f84 trytond/model/modelstorage.py
--- a/trytond/model/modelstorage.py Tue Jun 16 19:12:29 2020 +0200
+++ b/trytond/model/modelstorage.py Fri Jun 12 12:36:47 2020 +0200
@@ -1138,8 +1138,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))