TIP: You can type at any time to perform a new search.
Job Queue Batch
queue_job_batch · OCA/queue
- Repository
- OCA/queue · module folder · Try on Runboat
- Module version
- 1.0.0
- Category
- Generic Modules
- Folder size
- 0.1 MB
- License
- AGPL-3
- Application
- No
- Auto-installable
- No
- Website
- https://github.com/OCA/queue
- Last tracking update
- 2026-08-07 09:06:27
- Authors
- Odoo Community Association (OCA), Creu Blanca
- Maintainers
- Odoo Community Association (OCA), Creu Blanca
- Committers
- Stéphane Bidoul
- Odoo dependencies
- Python dependencies
- openupgradelib, requests
- System dependencies
- None
- Required by
- test_queue_job_batch
- Description
This addon adds an a grouper for queue jobs. It allows to show your jobs in a batched form in order to know better the results. Example: ``` python from odoo import models, fields, api class MyModel(models.Model): _name = 'my.model' 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' @api.multi def button_do_stuff(self): batch = self.env['queue.job.batch'].get_new_batch('Group') model = self.env['my.model'].with_context(job_batch=batch) for i in range(1, 100): model.with_delay().my_method('a', k=i) ``` In the snippet of code above, when we call `button_do_stuff`, 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. Once all the jobs have finished, the grouper will be marked as finished.
Code Analysis ⓘ
Views touched (5)
| XML ID | Name | Model | Type | Status |
|---|---|---|---|---|
view_queue_job_batch_form |
queue.job.batch.form | queue.job.batch | form | New |
view_queue_job_batch_search |
queue.job.batch.search | queue.job.batch | search | New |
view_queue_job_batch_tree |
queue.job.batch.tree | queue.job.batch | list | New |
view_queue_job_form |
queue.job.form | queue.job | form | Inherits queue_job.view_queue_job_form |
view_queue_job_search |
queue.job.search | queue.job | search | Inherits queue_job.view_queue_job_search |
HTTP endpoints (0)
No HTTP endpoints found for this module.
Models touched (3)
New fields (1)
-
job_batch_idMany2one → queue.job.batchargs: 'queue.job.batch'
-
create(self, vals_list)@api.model_create_multi -
write(self, vals)
New fields (11)
-
company_idMany2one → res.companyreadonly=True args: 'res.company' -
completenessFloatcompute='_compute_job_count' -
failed_job_countFloatcompute='_compute_job_count' -
failed_percentageFloatcompute='_compute_job_count' -
finished_job_countFloatcompute='_compute_job_count' -
is_readBoolean -
job_countIntegercompute='_compute_job_count' -
job_idsOne2many → queue.jobinverse_name='job_batch_id'readonly=True args: 'queue.job' -
nameCharreadonly=Truerequired=Truetracking=True -
stateSelectiondefault='pending'readonly=Truerequired=Truetracking=True args: [('pending', 'Pending'), ('enqueued', 'Enqueued'), ('progress', 'In Progress'), ('finished', 'Finished')] -
user_idMany2one → res.usersreadonly=Truerequired=Truetracking=True args: 'res.users'
-
check_state(self) -
get_new_batch(self, name, **kwargs)@api.model -
set_read(self)
New fields (0)
No new fields.
Public methods (0)No public methods.
Loading…
Loading…
Loading…
Loading…
Loading…