Search 1.9 billion lines of Odoo code on GitHub

queue_job_batch

Author: Creu Blanca,Odoo Community Association (OCA)
License: AGPL-3
Branch: 12.0
Repository: 001101/queue
Dependencies: queue_job, and web
Languages: HTML (364, 32.8%), JavaScript (130, 11.7%), Python (171, 15.4%), SVG (125, 11.3%), Sass (37, 3.3%), XML (228, 20.5%), and reStructuredText (55, 5.0%)
Other branches: 11.0
Other repositories: 2FM/queue, Alfa-90/queue, Callino/queue, Change2improve/queue, ChinaShrimp/queue, Comunitea/queue, DamonLiu0814/queue, Digital5-Odoo/queue, ERPLibre/queue, ForgeFlow/queue, Gabinete-Digital/queue, Ingeos/queue, Jarsa/queue, Leuan12/queue, MathBenTech/queue, MediaJockey/queue, MjAbuz/queue, NeatNerdPrime/queue, Numigi/queue, OCA-MUK/queue, OCA/queue, OpenAT/queue, RRRoger/queue, RSC-TECHNOLOGY-CI/queue, SanteLibre/queue, SequarSrl/queue, Syci-Consulting/queue, TRESCLOUD/queue, Tatider/queue, Tecnativa/queue, VCLS-org/queue, Vauxoo/queue, acsone/queue, akretion/queue, alsor62/queue, altanmur/queue, anggadjava/queue, anhvu-sg/queue, aurestic/queue, blueoceandevops/queue, bobslee/queue, boskowski/odoo_oca_queue, brain-tec/queue, camptocamp/queue, celm1990/queue, cogitoweb/queue, coopiteasy/queue, csveda/queue, diggy128/queue, dndoanh/queue, dong-z/queue, druidoo-dev/queue, dynapps/queue, ecosoft-odoo/queue, ehsu0407/queue, em230418/queue, etobella/queue, exosoftware/oca-queue, factorlibre/queue, glovebx/queue, guewen/queue, guwenfeng/queue, hibou-io/oca-queue, hinfo506/queue, hpatelserpentcs/queue, hq8399/queue, hzwzw/queue, ilyasbahridudak/queue, lideritjnma/queue, lincersolucoes/oca-queue, liweijie0812/queue, loftwah/queue, mauraco-group/queue, nadiaafa/queue, nilshamerlinck/queue, phatdo-novobi/queue, praxigento/oca-queue, profumang/queue, raizs/queue, rlfss/queue, royalline1/queue, sahil-navadiya/queue, sanube/queue, sewisoft/queue, shengyf1/queue, sotsam/queue, steingabelgaard/queue, sunflowerit/queue, sunshineLhj/queue, tajawal/queue, takinobori/oca-queue, tegin/queue, telesoho/queue, thanhchatvn/queue, themreza/queue, tirma-sa/queue, unitek-solusi/OCA-queue, ursais/queue, versada/queue, vnsofthe/queue, vrenaville/queue, wjshan/queue, wty0512/queue, x0rzkov/odoo-queue, xcgd/queue, xwh123807/queue, yucer/queue, and zakiuu/queue

<h1 class="title">Job Queue Batch</h1> <p><a class="reference external" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external" href="https://github.com/OCA/queue/tree/12.0/queue_job_batch"><img alt="OCA/queue" src="https://img.shields.io/badge/github-OCA%2Fqueue-lightgray.png?logo=github" /></a> <a class="reference external" href="https://translation.odoo-community.org/projects/queue-12-0/queue-12-0-queue_job_batch"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external" href="https://runbot.odoo-community.org/runbot/230/12.0"><img alt="Try me on Runbot" src="https://img.shields.io/badge/runbot-Try%20me-875A7B.png" /></a></p> <p>This addon adds an a grouper for queue jobs.</p> <p>It allows to show your jobs in a batched form in order to know better the results.</p> <p>Example:</p> <pre> <code lang="python">from odoo import models, fields, api from odoo.addons.queue_job.job import job class MyModel(models.Model): _name = 'my.model' &#64;api.multi &#64;job def my_method(self, a, k=None): _logger.info('executed with a: %s and k: %s', a, k) class MyOtherModel(models.Model): _name = 'my.other.model' &#64;api.multi def button_do_stuff(self): batch = self.env['queue.job.batch'].get_new_batch('Group') for i in range(1, 100): self.env['my.model'].with_context( job_batch=batch ).with_delay().my_method('a', k=i) batch.enqueue()</code> </pre> <p>In the snippet of code above, when we call <code>button_do_stuff</code>, 100 jobs capturing the method and arguments will be postponed. It will be executed as soon as the Jobrunner has a free bucket, which can be instantaneous if no other job is running.</p> <p>Once all the jobs have finished, the grouper will be marked as finished.</p> <p><strong>Table of contents</strong></p> <div class="contents local topic" id="contents"> <ul class="simple"> <li><a class="reference internal" href="#usage" id="id1">Usage</a></li> <li><a class="reference internal" href="#bug-tracker" id="id2">Bug Tracker</a></li> <li><a class="reference internal" href="#credits" id="id3">Credits</a><ul> <li><a class="reference internal" href="#authors" id="id4">Authors</a></li> <li><a class="reference internal" href="#contributors" id="id5">Contributors</a></li> <li><a class="reference internal" href="#maintainers" id="id6">Maintainers</a></li> </ul> </li> </ul> </div> <a name="usage"></a> <h2><a class="toc-backref" href="#id1">Usage</a></h2> <p>You can manage your batch jobs from the Systray. A new button will be shown with your currently executing job batches and the recently finished job groups.</p> <a name="bug-tracker"></a> <h2><a class="toc-backref" href="#id2">Bug Tracker</a></h2> <p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/queue/issues">GitHub Issues</a>. In case of trouble, please check there if your issue has already been reported. If you spotted it first, help us smashing it by providing a detailed and welcomed <a class="reference external" href="https://github.com/OCA/queue/issues/new?body=module:%20queue_job_batch%0Aversion:%2012.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p> <p>Do not contact contributors directly about support or help with technical issues.</p> <a name="credits"></a> <h2><a class="toc-backref" href="#id3">Credits</a></h2> <a name="authors"></a> <h3><a class="toc-backref" href="#id4">Authors</a></h3> <ul class="simple"> <li>Creu Blanca</li> </ul> <a name="contributors"></a> <h3><a class="toc-backref" href="#id5">Contributors</a></h3> <ul class="simple"> <li>Enric Tobella &lt;<a class="reference external" href="mailto:etobella&#64;creublanca.es">etobella&#64;creublanca.es</a>&gt;</li> <li>Lois Rilo &lt;<a class="reference external" href="mailto:lois.rilo&#64;eficent.com">lois.rilo&#64;eficent.com</a>&gt;</li> </ul> <a name="maintainers"></a> <h3><a class="toc-backref" href="#id6">Maintainers</a></h3> <p>This module is maintained by the OCA.</p> <a class="reference external image-reference" href="https://odoo-community.org"><img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" /></a> <p>OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use.</p> <p>This module is part of the <a class="reference external" href="https://github.com/OCA/queue/tree/12.0/queue_job_batch">OCA/queue</a> project on GitHub.</p> <p>You are welcome to contribute. To learn how please visit <a class="reference external" href="https://odoo-community.org/page/Contribute">https://odoo-community.org/page/Contribute</a>.</p>