changeset 728cb4a36144 in trytond:default
details: https://hg.tryton.org/trytond?cmd=changeset;node=728cb4a36144
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
diffstat:
trytond/model/modelstorage.py | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)
diffs (13 lines):
diff -r 7868c2ae87c0 -r 728cb4a36144 trytond/model/modelstorage.py
--- a/trytond/model/modelstorage.py Sat Jun 06 14:04:01 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))