Skip to content

[20.0][MIG] queue_job: Migration to 20.0 - #999

Open
dhongu wants to merge 8 commits into
OCA:20.0from
dhongu:20.0-mig-queue_job
Open

dhongu wants to merge 8 commits into
OCA:20.0from
dhongu:20.0-mig-queue_job

Conversation

@dhongu

@dhongu dhongu commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

Migration of queue_job to Odoo 20.0.

Main changes:

  • ir.model.access + ir.rule → ir.access
  • registry.clear_cache → transaction.invalidate_ormcache
  • controller: use odoo.sql_db.PG_CONCURRENCY_EXCEPTIONS_TO_RETRY (odoo.service.model was removed); env.clear() → env.transaction.clear()
  • jobrunner: odoo.modules.db.list_dbs (odoo.service.db was removed)
  • fields: _setup_attrs → _setup_attrs__; tools.ormcache → api.ormcache
  • JS: job_direct_graph widget ported to Owl 3 (useProps, signal ref)
  • views: remaining_days widget → relative_date; stat button icon
  • tests: odoo.http.Request → odoo.http.requestlib.Request
  • lint fixes required by the 20.0 template (ruff 0.16.8, pylint-odoo 10): a few small refactors, and # noqa: DTZ005 on datetime.now() because Odoo stores naive UTC datetimes

Tested locally on Odoo 20.0 with PostgreSQL 16: the module installs and all 54 queue_job tests pass. pre-commit run -a is clean.

This PR also includes the work prepared by @jaredkipe in #997 (co-authored).

test_queue_job and the other addons will follow in separate PRs.

🤖 Generated with Claude Code

@oca-cla-bot

oca-cla-bot Bot commented Sep 28, 2026 •

Copy link
Copy Markdown

All commit authors signed the Contributor License Agreement.

CLA signed

@Reyes4711-S73

Copy link
Copy Markdown

@BhaveshHeliconia BhaveshHeliconia left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @dhongu for working on this!

While testing, I found that clicking another job in the Dependencies tab raises an error because get_formview_action() was removed in Odoo 20.0.

Fix: build the form action directly in JS instead of asking the server, then pass it to this.action.doAction(). I tried this locally and the click opens the job correctly.

@micheledic micheledic left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding to this, you should preserve the full history.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"get_record_default_action",

HoloborodkoBohdan and others added 8 commits October 16, 2026 11:40
Odoo 19 renamed Field._setup_attrs to _setup_attrs__, so the override
was no longer called and an unsupported base_type was silently accepted.
The failure is handled from a temporary cursor while the failed job's
transaction still holds its locks: an on fail hook writing on the same
records waited forever. Perform the job in a savepoint so that its
locks are released when it fails.
odoo shell starts the server with stop=True and stops it right away, so the
runner thread was started for nothing and its START_DELAY made every shell
wait 5 seconds before the prompt. Core already skips its HTTP and cron threads
when stop is set; the runner now follows the same rule.
- ir.model.access + ir.rule -> ir.access
- registry.clear_cache -> transaction.invalidate_ormcache
- controller: use odoo.sql_db.PG_CONCURRENCY_EXCEPTIONS_TO_RETRY
  (odoo.service.model was removed); env.clear() -> env.transaction.clear()
- jobrunner: odoo.modules.db.list_dbs (odoo.service.db was removed)
- fields: _setup_attrs -> _setup_attrs__; tools.ormcache -> api.ormcache
- JS: job_direct_graph widget ported to Owl 3 (useProps, signal ref);
  get_formview_action -> get_record_default_action (removed in 20.0)
- views: remaining_days widget -> relative_date; stat button icon
- tests: odoo.http.Request -> odoo.http.requestlib.Request
- lint fixes required by the 20.0 template (ruff 0.16, pylint-odoo 10)

Co-authored-by: Jared Kipe <jared@hibou.io>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@dhongu
dhongu force-pushed the 20.0-mig-queue_job branch from 6748713 to 2b08ccd Compare October 16, 2026 09:09
@dhongu

dhongu commented Oct 16, 2026

Copy link
Copy Markdown
Contributor Author

Thanks for the reviews, both points are addressed:

  • History: the branch is rebuilt following the 20.0 migration guide (git format-patch ... origin/20.0..origin/19.0 -- queue_job | git am -3 --keep). The 19.0 commits merged after the 20.0 branch was created are now included (JobSerialized base_type validation, on-fail hook deadlock, jobrunner in odoo shell), followed by a [IMP] pre-commit auto fixes commit and the [MIG] commit.
  • Dependencies tab: get_formview_action → get_record_default_action, as suggested by @micheledic. Thanks @BhaveshHeliconia for the report.

pre-commit run -a is clean and all 56 queue_job tests pass locally on Odoo 20.0.

@BhaveshHeliconia BhaveshHeliconia left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@BhaveshHeliconia

Copy link
Copy Markdown

You shouldn't add the AI agent as a co-author. It should be mentioned as assisted by AI according to the OCA AI policy: https://github.com/OCA/.github/blob/master/AI_POLICY.md

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants