changeset e657564e3359 in trytond:6.4
details: https://hg.tryton.org/trytond?cmd=changeset&node=e657564e3359
description:
Ignore write and delete rule domains if they are the same as the read
domain
issue11480
review419121003
(grafted from 9907fbf058a69b0e1520d3b7f5ffe4050eb24e2f)
diffstat:
trytond/model/modelsql.py | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
diffs (15 lines):
diff -r a554cf1f05c6 -r e657564e3359 trytond/model/modelsql.py
--- a/trytond/model/modelsql.py Wed May 25 17:38:34 2022 +0200
+++ b/trytond/model/modelsql.py Tue May 31 23:47:56 2022 +0200
@@ -790,7 +790,10 @@
if not callable(cls.table_query):
rule_domain = Rule.domain_get(
cls.__name__, mode=f.lstrip('_'))
- if rule_domain:
+ # No need to compute rule domain if it is the same as the
+ # read rule domain because it is already applied as where
+ # clause.
+ if rule_domain and rule_domain != domain:
rule_tables = {None: (table, None)}
rule_tables, rule_expression = cls.search_domain(
rule_domain, active_test=False, tables=rule_tables)