changeset d4747a93f1f9 in trytond:5.0
details: https://hg.tryton.org/trytond?cmd=changeset;node=d4747a93f1f9
description:
        Use non grouped domain when grouped record > IN_MAX

        The break when grouped records are greater than IN_MAX, should break 
all the
        loops in order to prevent use of the grouped domain.

        issue8474
        review257701002
        (grafted from 4f54d7c7dc50c5089cd4a4f27495dc41bdf2c36c)
diffstat:

 trytond/model/modelstorage.py |  9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diffs (26 lines):

diff -r b1a6ae23b050 -r d4747a93f1f9 trytond/model/modelstorage.py
--- a/trytond/model/modelstorage.py     Sat Jul 13 00:06:22 2019 +0200
+++ b/trytond/model/modelstorage.py     Sat Jul 13 00:08:30 2019 +0200
@@ -981,7 +981,8 @@
                     in_max = Transaction().database.IN_MAX
                     count = in_max // 10
                     new_domains = {}
-                    for sub_domains in grouped_slice(list(domains.keys()), 
count):
+                    for sub_domains in grouped_slice(
+                            list(domains.keys()), count):
                         grouped_domain = ['OR']
                         grouped_records = []
                         for d in sub_domains:
@@ -992,7 +993,11 @@
                                 break
                             grouped_domain.append(
                                 [('id', 'in', [r.id for r in relations]), d])
-                        new_domains[freeze(grouped_domain)] = grouped_records
+                        else:
+                            new_domains[freeze(grouped_domain)] = \
+                                grouped_records
+                            continue
+                        break
                     else:
                         domains = new_domains
             else:

Reply via email to