changeset f0038b0a1844 in trytond:6.0
details: https://hg.tryton.org/trytond?cmd=changeset&node=f0038b0a1844
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 e6d874f3d9e1 -r f0038b0a1844 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
@@ -743,7 +743,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)

Reply via email to