[18.0][FEAT] replace threading by queue job #1096
Open
[18.0][FEAT] replace threading by queue job #1096
Conversation
acb390a to
7e91022
Compare
Contributor
|
You should mention in description this is based on
IMO we should push to have these other PRs merged before taking care of this one |
93cbb96 to
5dd1501
Compare
Author
the pr: add advisory lock by batch for generation #1075 will be closed as soon as this one is merged as it's not necessary anymore. I'll then remove the related commits from this PR |
5dd1501 to
910880a
Compare
cyrilmanuel
approved these changes
Dec 23, 2025
b87e0ad to
e52af15
Compare
8ebb0f5 to
c9db64f
Compare
777f94d to
116a423
Compare
- change name to batch to match with change of `picking_dispatch` name to `stock_batch_picking` - mode description in README.rst - move files in models and views directories - change headers to small license header - use api 8.0 - fix and improve tests
the field has been renamed in the base module
Probably due to usage of multiple environment and cache. datas can't be read from shipping.label but it can be read from ir.attachment
When there is more than 1 pack in a picking, 2 or more thread worker might be in concurrence on the same picking, which makes one of the transaction fails, resulting in the abort of the whole label generation. The solution implemented is to change the way of passing the tasks to the thread workers. Instead of passing a label at a time, we pass a group of label. A group of label actually contains all the labels to generate for one picking.
… by ``UserError.args[0]`` In the label generation, when getting an error, we were using its ``name``, however, this is deprecated since a while and as been removed in odoo/odoo@d200dcf. We should use ``args[0]`` instead.
… return ``stock.move.line`` records instead of an Iterator All calls to this method expect ``stock.move.line`` records.
Regenerating the carrier labels would crash with a Concurent Update error. We use a new cursor for tracking reference purge and avoid concurrent update when the labels regeneration also updates that field in a separate cursor afterwards: this ensures that the purge is committed before the transactions created by the threads also update and commit their own changes.
Don't spawn more threads than needed: if there are fewer groups to process than the configured max number of threads, only start the specified number of threads.
2674610 to
210637c
Compare
210637c to
086e466
Compare
guewen
reviewed
Feb 10, 2026
guewen
reviewed
Feb 10, 2026
guewen
reviewed
Feb 23, 2026
afe9e6e to
609eb5b
Compare
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.
This PR is based on [18.0][MIG] delivery_carrier_label_batch: Migration to 18.0 #984