changeset 59893ff64214 in modules/sale_complaint:default
details: 
https://hg.tryton.org/modules/sale_complaint?cmd=changeset&node=59893ff64214
description:
        Add batch option to push queue tasks

        issue11129
        review381661002
diffstat:

 complaint.py |  7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diffs (19 lines):

diff -r 27a1534e746f -r 59893ff64214 complaint.py
--- a/complaint.py      Tue Feb 15 00:08:47 2022 +0100
+++ b/complaint.py      Wed Mar 09 00:57:17 2022 +0100
@@ -301,10 +301,13 @@
     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

Reply via email to