Skip to content
Health
86/100
good
  • Security25/25
    No findings
  • Activityn/a
    No commit data
  • Required by15/25
    1 module depends on it
  • Maturity25/25
    In 7 Odoo series since 11.0

Heuristic over the facts below, not an audit · How it's computed

Security findings
Grave / minor (static analysis)
Required by
1
Modules depending on it
External deps
2 pip · 0 bin
Python packages / system binaries
License
AGPL-3
No conflicts with its dependencies
Folder size
0.1 MB
Module directory on disk
Code analysis 0 migration notes 3 models 5 views 0 HTTP endpoints

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:

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.

Dependencies

Odoo dependencies
OCA/queue:
odoo/odoo:
- web
- bus
Python dependencies
openupgradelib, requests
System dependencies
None
Required by
test_queue_job_batch

Code analysis

Extracted from the source by best-effort static analysis (no code is executed); details may be incomplete.

Views touched 5

XML IDNameModelTypeStatus
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_id Many2one → queue.job.batch
    args: 'queue.job.batch'
Public methods (2)
  • create(self, vals_list)
    @api.model_create_multi
  • write(self, vals)

New fields (11)
  • company_id Many2one → res.company
    readonly=True args: 'res.company'
  • completeness Float
    compute='_compute_job_count'
  • failed_job_count Float
    compute='_compute_job_count'
  • failed_percentage Float
    compute='_compute_job_count'
  • finished_job_count Float
    compute='_compute_job_count'
  • is_read Boolean
  • job_count Integer
    compute='_compute_job_count'
  • job_ids One2many → queue.job
    inverse_name='job_batch_id' readonly=True args: 'queue.job'
  • name Char
    readonly=True required=True tracking=True
  • state Selection
    default='pending' readonly=True required=True tracking=True args: [('pending', 'Pending'), ('enqueued', 'Enqueued'), ('progress', 'In Progress'), ('finished', 'Finished')]
  • user_id Many2one → res.users
    readonly=True required=True tracking=True args: 'res.users'
Public methods (3)
  • 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…

Loading…

Loading…