[19.0][MIG] queue_job_batch, test_queue_job_batch: Migration to 19.0 - #977
Open
desarrollonextpro wants to merge 2 commits into
Open
[19.0][MIG] queue_job_batch, test_queue_job_batch: Migration to 19.0#977desarrollonextpro wants to merge 2 commits into
desarrollonextpro wants to merge 2 commits into
Conversation
- 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
force-pushed
the
19.0-mig-queue_job_batch
branch
from
August 31, 2026 21:45
2797481 to
8533f37
Compare
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.
Member
|
I think you didn't follow all OCA migration guidelines, as I don't see previous commits. Can you check? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Migration of
queue_job_batchandtest_queue_job_batchto 19.0. Part of #831.Changes required by 19.0
res.groups.category_idno longer exists: the security group now usesprivilege_idpointing atqueue_job.privilege_queue_job, introduced by thequeue_jobmigration.<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 byadd_global_values().webclientcontroller: in 19.0 it is aclassmethodwith the(store, name, params)signature, and the systray is requested by name rather than through a keyword flag.Store.esm.js:initMessagingParamsdoes not exist in 19.0. Replaced by the core pattern, a patch oninitialize()callingfetchStoreData(). Worth noting: the old patch overrode a getter nothing calls, so the systray request was silently never sent.QueueJobBatchMenu.esm.js:fetchData()replaced byfetchStoreData().installableinside theassetsdict; cleaned up.Not included on purpose
The multi-company
ir.rulestill uses('company_id', 'child_of', [user.company_id.id])whilequeue_jobmoved to('company_id', 'in', company_ids)indecd9c93(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_batchinstalls and its tests pass (3 tests, 0 failed), coveringget_new_batch, thejob_batchcontext key,check_state,completenessandset_read.The frontend was not validated in a browser: the systray menu rendering, the
ColumnProgressbars and the bus-driven counter update still need manual verification.cc @etobella