Skip to content

[19.0][MIG] queue_job_batch, test_queue_job_batch: Migration to 19.0 - #977

Open
desarrollonextpro wants to merge 2 commits into
OCA:19.0from
desarrollonextpro:19.0-mig-queue_job_batch
Open

[19.0][MIG] queue_job_batch, test_queue_job_batch: Migration to 19.0#977
desarrollonextpro wants to merge 2 commits into
OCA:19.0from
desarrollonextpro:19.0-mig-queue_job_batch

Conversation

@desarrollonextpro

Copy link
Copy Markdown

Migration of queue_job_batch and test_queue_job_batch to 19.0. Part of #831.

Changes required by 19.0

  • res.groups.category_id no longer exists: the security group now uses privilege_id pointing at queue_job.privilege_queue_job, introduced by the queue_job migration.
  • Search view: the <group expand="0" string="Group By"> wrapper was removed in 19.0; the group-by filters are declared flat after a <separator/>.
  • Store.add() no longer accepts a dict and _to_store() takes two positional arguments: the batch now declares _to_store_defaults() like the core models, which also removes 15 lines of manual field reading.
  • res.users: store.add({...}) replaced by add_global_values().
  • webclient controller: in 19.0 it is a classmethod with the (store, name, params) signature, and the systray is requested by name rather than through a keyword flag.
  • Store.esm.js: initMessagingParams does not exist in 19.0. Replaced by the core pattern, a patch on initialize() calling fetchStoreData(). Worth noting: the old patch overrode a getter nothing calls, so the systray request was silently never sent.
  • QueueJobBatchMenu.esm.js: fetchData() replaced by fetchStoreData().
  • The manifest declared installable inside the assets dict; cleaned up.

Not included on purpose

The multi-company ir.rule still uses ('company_id', 'child_of', [user.company_id.id]) while queue_job moved to ('company_id', 'in', company_ids) in decd9c93 (13.0). That is a pre-existing inconsistency, not a 19.0 breakage; changing a security rule inside a migration would widen the scope. It should go in a separate [FIX].

Testing

test_queue_job_batch installs and its tests pass (3 tests, 0 failed), covering get_new_batch, the job_batch context key, check_state, completeness and set_read.

The frontend was not validated in a browser: the systray menu rendering, the ColumnProgress bars and the bus-driven counter update still need manual verification.

cc @etobella

@oca-cla-bot

oca-cla-bot Bot commented Aug 31, 2026

Copy link
Copy Markdown

All commit authors signed the Contributor License Agreement.

CLA signed

@OCA-git-bot OCA-git-bot added series:19.0 mod:queue_job_batch Module queue_job_batch mod:test_queue_job_batch Module test_queue_job_batch labels Aug 31, 2026
- Manifest: drop the installable flag the migration bot injected inside the
  assets dict, bump both modules to 19.0.1.0.0 and make them installable.
- Security: res.groups.category_id no longer exists in 19.0. Point the batch
  user group at queue_job.privilege_queue_job, the res.groups.privilege record
  created when queue_job was migrated.
- Search view: 19.0 drops the <group expand="0" string="Group By"> wrapper;
  the groupby filters are now flat, after a separator.
- queue.job.batch: Store.add() calls _to_store(store, fields) with two
  positional arguments in 19.0. Declare the serialized fields in
  _to_store_defaults() and let Store read them, as the core models do.
- res.users: store globals are added with add_global_values(); Store.add()
  expects a recordset, not a mapping.
- Webclient controller: _process_request_for_internal_user is a classmethod
  taking (store, name, params) in 19.0, and the systray payload is requested
  by name instead of through a keyword flag.
- Store patch: initMessagingParams no longer exists. Request the counter from
  initialize() with fetchStoreData(), which also replaces fetchData() in the
  systray menu.
@desarrollonextpro
desarrollonextpro force-pushed the 19.0-mig-queue_job_batch branch from 2797481 to 8533f37 Compare August 31, 2026 21:45
The 19.0 migration changed three Python surfaces that had no test at all: the
store payload of the batch, the group flag published by `res.users`, and the
systray request in the webclient controller.

- `_to_store_defaults` replaced a hand-written read of the progress fields.
  Dropping one of them leaves the client without the value and the progress bar
  renders empty with no error, so the list itself is the contract.
- `_init_store_data` publishes `hasQueueJobBatchUserGroup`, which is what makes
  the systray appear at all. Covered on both sides of the group.
- The controller now dispatches **by name** instead of by a keyword flag. The
  added guard asserts that an unrelated request does *not* receive the batch
  counter: that is the failure mode the new signature introduces, and a test that
  only checked the payload would not notice the controller answering everything.

Each test was verified by mutation: removing a field from `_to_store_defaults`,
pinning the group flag to False, widening the controller guard to every request,
and dropping `store.add(batches)` each turn exactly one test red.
@etobella

etobella commented Sep 1, 2026

Copy link
Copy Markdown
Member

I think you didn't follow all OCA migration guidelines, as I don't see previous commits. Can you check?

@etobella etobella closed this Sep 1, 2026
@etobella etobella reopened this Sep 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

mod:queue_job_batch Module queue_job_batch mod:test_queue_job_batch Module test_queue_job_batch series:19.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants