|
| 1 | +=============== |
| 2 | +Job Queue Batch |
| 3 | +=============== |
| 4 | + |
| 5 | +.. |
| 6 | + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
| 7 | + !! This file is generated by oca-gen-addon-readme !! |
| 8 | + !! changes will be overwritten. !! |
| 9 | + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
| 10 | + !! source digest: sha256:7eceb569ec18547f2b64717734aecc66c0db338d51e13d6f1324785c6c2f8407 |
| 11 | + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
| 12 | +
|
| 13 | +.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png |
| 14 | + :target: https://odoo-community.org/page/development-status |
| 15 | + :alt: Beta |
| 16 | +.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png |
| 17 | + :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html |
| 18 | + :alt: License: AGPL-3 |
| 19 | +.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fqueue-lightgray.png?logo=github |
| 20 | + :target: https://github.com/OCA/queue/tree/18.0/queue_job_batch |
| 21 | + :alt: OCA/queue |
| 22 | +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png |
| 23 | + :target: https://translation.odoo-community.org/projects/queue-18-0/queue-18-0-queue_job_batch |
| 24 | + :alt: Translate me on Weblate |
| 25 | +.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png |
| 26 | + :target: https://runboat.odoo-community.org/builds?repo=OCA/queue&target_branch=18.0 |
| 27 | + :alt: Try me on Runboat |
| 28 | + |
| 29 | +|badge1| |badge2| |badge3| |badge4| |badge5| |
| 30 | + |
| 31 | +This addon adds an a grouper for queue jobs. |
| 32 | + |
| 33 | +It allows to show your jobs in a batched form in order to know better |
| 34 | +the results. |
| 35 | + |
| 36 | +Example: |
| 37 | + |
| 38 | +.. code:: python |
| 39 | +
|
| 40 | + from odoo import models, fields, api |
| 41 | +
|
| 42 | +
|
| 43 | + class MyModel(models.Model): |
| 44 | + _name = 'my.model' |
| 45 | +
|
| 46 | + def my_method(self, a, k=None): |
| 47 | + _logger.info('executed with a: %s and k: %s', a, k) |
| 48 | +
|
| 49 | +
|
| 50 | + class MyOtherModel(models.Model): |
| 51 | + _name = 'my.other.model' |
| 52 | +
|
| 53 | + @api.multi |
| 54 | + def button_do_stuff(self): |
| 55 | + batch = self.env['queue.job.batch'].get_new_batch('Group') |
| 56 | + model = self.env['my.model'].with_context(job_batch=batch) |
| 57 | + for i in range(1, 100): |
| 58 | + model.with_delay().my_method('a', k=i) |
| 59 | +
|
| 60 | +In the snippet of code above, when we call ``button_do_stuff``, 100 jobs |
| 61 | +capturing the method and arguments will be postponed. It will be |
| 62 | +executed as soon as the Jobrunner has a free bucket, which can be |
| 63 | +instantaneous if no other job is running. |
| 64 | + |
| 65 | +Once all the jobs have finished, the grouper will be marked as finished. |
| 66 | + |
| 67 | +**Table of contents** |
| 68 | + |
| 69 | +.. contents:: |
| 70 | + :local: |
| 71 | + |
| 72 | +Usage |
| 73 | +===== |
| 74 | + |
| 75 | +You can manage your batch jobs from the Systray. A new button will be |
| 76 | +shown with your currently executing job batches and the recently |
| 77 | +finished job groups. |
| 78 | + |
| 79 | +Bug Tracker |
| 80 | +=========== |
| 81 | + |
| 82 | +Bugs are tracked on `GitHub Issues <https://github.com/OCA/queue/issues>`_. |
| 83 | +In case of trouble, please check there if your issue has already been reported. |
| 84 | +If you spotted it first, help us to smash it by providing a detailed and welcomed |
| 85 | +`feedback <https://github.com/OCA/queue/issues/new?body=module:%20queue_job_batch%0Aversion:%2018.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_. |
| 86 | + |
| 87 | +Do not contact contributors directly about support or help with technical issues. |
| 88 | + |
| 89 | +Credits |
| 90 | +======= |
| 91 | + |
| 92 | +Authors |
| 93 | +------- |
| 94 | + |
| 95 | +* Creu Blanca |
| 96 | + |
| 97 | +Contributors |
| 98 | +------------ |
| 99 | + |
| 100 | +- Enric Tobella < [email protected]> |
| 101 | + |
| 102 | +- `Trobz <https://trobz.com>`__: |
| 103 | + |
| 104 | + |
| 105 | + |
| 106 | +- `ForgeFlow <https://forgeflow.com>`__: |
| 107 | + |
| 108 | + |
| 109 | + - Jasmin Solanki < [email protected]> |
| 110 | + |
| 111 | +- `Camptocamp <https://camptocamp.com>`__: |
| 112 | + |
| 113 | + - Maksym Yankin < [email protected]> |
| 114 | + - Iván Todorovich < [email protected]> |
| 115 | + |
| 116 | +Other credits |
| 117 | +------------- |
| 118 | + |
| 119 | +The migration of this module from 12.0 to 14.0 was financially supported |
| 120 | +by Camptocamp |
| 121 | + |
| 122 | +Maintainers |
| 123 | +----------- |
| 124 | + |
| 125 | +This module is maintained by the OCA. |
| 126 | + |
| 127 | +.. image:: https://odoo-community.org/logo.png |
| 128 | + :alt: Odoo Community Association |
| 129 | + :target: https://odoo-community.org |
| 130 | + |
| 131 | +OCA, or the Odoo Community Association, is a nonprofit organization whose |
| 132 | +mission is to support the collaborative development of Odoo features and |
| 133 | +promote its widespread use. |
| 134 | + |
| 135 | +This module is part of the `OCA/queue <https://github.com/OCA/queue/tree/18.0/queue_job_batch>`_ project on GitHub. |
| 136 | + |
| 137 | +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. |
0 commit comments