changeset 1be168e3075f in trytond:6.2
details: https://hg.tryton.org/trytond?cmd=changeset&node=1be168e3075f
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 ac5fee1a52fe -r 1be168e3075f 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
@@ -759,7 +759,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)