From f249bb169c41f08e3543e5a63ba1fa4e19f3db09 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Wed, 9 Mar 2022 00:57:17 +0100 Subject: [PATCH] Add batch option to push queue tasks issue11129 review381661002 --- complaint.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/complaint.py b/complaint.py index f90b9c604a..b08054ba2f 100644 --- a/complaint.py +++ b/complaint.py @@ -301,10 +301,13 @@ class Complaint(Workflow, ModelSQL, ModelView): def approve(cls, complaints): pool = Pool() Configuration = pool.get('sale.configuration') + transaction = Transaction() + context = transaction.context config = Configuration(1) - with Transaction().set_context( + with transaction.set_context( queue_name='sale', - queue_scheduled_at=config.sale_process_after): + queue_scheduled_at=config.sale_process_after, + queue_batch=context.get('queue_batch', True)): cls.__queue__.process(complaints) @classmethod