From dda35caa211f2a5a9771e07cdaf3eebaad422625 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Sat, 13 Apr 2024 14:20:21 +0200 Subject: [PATCH] Test if queue batch is boolean In Python bool type is a subtype of integer so it must be tested first. Also by converting other types to int, we catch any other wrong types. Closes #13133 --- trytond/trytond/ir/queue_.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/trytond/trytond/ir/queue_.py b/trytond/trytond/ir/queue_.py index b1a985b059..84e3012d78 100644 --- a/trytond/trytond/ir/queue_.py +++ b/trytond/trytond/ir/queue_.py @@ -248,10 +248,10 @@ class _Method(object): if isinstance(instances, list): if has_worker and queue_batch: - if isinstance(queue_batch, int): - count = queue_batch - else: + if isinstance(queue_batch, bool): count = batch_size + else: + count = int(queue_batch) else: count = len(instances) task_ids = []