Skip to content

Conversation

@KalpeshGajera
Copy link

No description provided.

Guewen Baconnier and others added 30 commits November 12, 2020 16:08
This patch method has to be called in ``_register_hook``.

When a method is patched, any call to the method will not directly
execute the method's body, but will instead enqueue a job.

When a ``context_key`` is set when calling ``_patch_job_auto_delay``,
the patched method is automatically delayed only when this key is
``True`` in the caller's context. It is advised to patch the method
with a ``context_key``, because making the automatic delay *in any
case* can produce nasty and unexpected side effects (e.g. another
module calls the method and expects it to be computed before doing
something else, expecting a result, ...).

A typical use case is when a method in a module we don't control is called
synchronously in the middle of another method, and we'd like all the calls
to this method become asynchronous.

It relies on OCA#274 that deprecates the
`@job` decorator.
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: queue-13.0/queue-13.0-queue_job
Translate-URL: https://translation.odoo-community.org/projects/queue-13-0/queue-13-0-queue_job/
Signed-off-by guewen
Following changes of OCA#281
The initial sudo() is lost when we call "with_env()" with a False su
flag. Ensure the read job.record keeps a su flag.
Signed-off-by guewen
Signed-off-by guewen
Currently translated at 86.5% (116 of 134 strings)

Translation: queue-13.0/queue-13.0-queue_job
Translate-URL: https://translation.odoo-community.org/projects/queue-13-0/queue-13-0-queue_job/zh_CN/
Currently translated at 89.5% (120 of 134 strings)

Translation: queue-13.0/queue-13.0-queue_job
Translate-URL: https://translation.odoo-community.org/projects/queue-13-0/queue-13-0-queue_job/zh_CN/
Signed-off-by simahawk
These fields should not be changed by users.
Everytime a job is created, a mail.message "Queue Job created" is
created. This is useless, as we already have the creation date and user,
and nobody will ever want to receive a notification for a created job
anyway.

Removing the on creation auto-subscription of the user that created the
job makes sense as well since we automatically subscribe the queue job
managers for failures. Add the owner of the jobs to the followers on
failures only as well.

It allows to remove a lot of insertions of records (and of deletions
when autovacuuming jobs).
Signed-off-by guewen
Several fields on queue.job are initialized using computed fields,
then never changed again. On creation of a queue.job record, we'll have
an initial INSERT + at least one following UPDATE for the computed
fields.

Replace all the stored computed fields by a raw initialization of the
values in `Job.store()` when the job is created, so we have only a
single INSERT.

Highlights:

* as channel is no longer a compute/inverse field, override_channel is
  useless, I dropped it (actually the same value was stored in both
  channel and override_channel as the channel field was stored)
* one functional diff is that now, when changing a channel on a
  job.function, the channel is no longer synchronized on existing jobs,
  it will be applied only on new jobs: actually this is an improvement,
  because it was impossible to change the channel of a job function
  in a large queue_job table as it meant writing on all the done/started
  jobs
* searching the queue.job.function is now cached, as each job using the
  same will run a query on queue_job_function
Signed-off-by simahawk
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: queue-13.0/queue-13.0-queue_job
Translate-URL: https://translation.odoo-community.org/projects/queue-13-0/queue-13-0-queue_job/
Signed-off-by simahawk
When RetryableJobError was raised, any change done by the job was not
rollbacked.

Using `raise` would throw the exception up to the core and rollback, but
we would have a stack trace in the logs for each try. Calling rollback
manually (rollback also clears the env) hide the tracebacks, however,
when the last try fails, the full traceback is still shown in the logs.

Fixes OCA#261
OCA-git-bot and others added 24 commits February 11, 2021 10:05
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: queue-13.0/queue-13.0-queue_job
Translate-URL: https://translation.odoo-community.org/projects/queue-13-0/queue-13-0-queue_job/
Signed-off-by guewen
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: queue-13.0/queue-13.0-queue_job
Translate-URL: https://translation.odoo-community.org/projects/queue-13-0/queue-13-0-queue_job/
Signed-off-by guewen
Signed-off-by simahawk
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: queue-13.0/queue-13.0-queue_job
Translate-URL: https://translation.odoo-community.org/projects/queue-13-0/queue-13-0-queue_job/
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: queue-13.0/queue-13.0-test_queue_job
Translate-URL: https://translation.odoo-community.org/projects/queue-13-0/queue-13-0-test_queue_job/
The float_time widget shows hours seconds, we only want seconds.
The widget had been removed on the form view, but not on the tree view.
Signed-off-by guewen
…b will not execute untill parent will be done.
@KalpeshGajera KalpeshGajera changed the title Apx 825 APX-825 Jan 12, 2022
@guewen
Copy link
Member

guewen commented Jan 29, 2022

Hi @KalpeshGajera, I see you are working on a dependency system for jobs. You should have a look on #154 which is waiting for reviews. The latter PR targets 12.0, but as it is not approved yet, I never worked on adapting it to newer versions.

@guewen
Copy link
Member

guewen commented Jan 29, 2022

@KalpeshGajera here's the version for odoo 14.0 #403

@github-actions
Copy link

github-actions bot commented Jun 5, 2022

There hasn't been any activity on this pull request in the past 4 months, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 30 days.
If you want this PR to never become stale, please ask a PSC member to apply the "no stale" label.

@github-actions github-actions bot added the stale PR/Issue without recent activity, it'll be soon closed automatically. label Jun 5, 2022
@github-actions github-actions bot closed this Jul 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

stale PR/Issue without recent activity, it'll be soon closed automatically.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

10 participants