Skip to content
Snippets Groups Projects
Commit ca162228 authored by Cédric Krier's avatar Cédric Krier :atom:
Browse files

Add batch option to push queue tasks

issue11129
review381661002
parent b28e5ff8
1 merge request!114Return an empty list when the treeview has no selection
......@@ -6,6 +6,7 @@
from trytond.modules.product import price_digits
from trytond.pool import Pool, PoolMeta
from trytond.pyson import Bool, Eval, If
from trytond.transaction import Transaction
from .exceptions import AmendmentValidateError
......@@ -99,6 +100,8 @@
def validate_amendment(cls, amendments):
pool = Pool()
Sale = pool.get('sale.sale')
transaction = Transaction()
context = transaction.context
sales = set()
for amendment in amendments:
sale = amendment.sale
......@@ -120,7 +123,9 @@
Sale.save(sales)
Sale.store_cache(sales)
cls._clear_sale(sales)
Sale.__queue__.process(sales)
with transaction.set_context(
queue_batch=context.get('queue_batch', True)):
Sale.__queue__.process(sales)
@classmethod
def _clear_sale(cls, sales):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment