Ensure count of grouped_slice is at least 1
issue8474 review257701002
This commit is contained in:
1 parent
a8fc7f0e50
commit
3c5cec7bf1
1 file changed
+1
@@ -225,6 +225,7 @@ def grouped_slice(records, count=None):
|
||||
from trytond.transaction import Transaction
|
||||
if count is None:
|
||||
count = Transaction().database.IN_MAX
|
||||
count = max(1, count)
|
||||
for i in range(0, len(records), count):
|
||||
yield islice(records, i, i + count)
|
||||
|
||||
|
||||
Reference in new issue
Block a user