Make queue_job/controllers/main.py compatible with Python 3.9#892
Merged
Conversation
Replace Job | None with Optional[Job] and add typing import.
Contributor
Member
|
/ocabot merge patch |
Contributor
|
What a great day to merge this nice PR. Let's do it! |
Contributor
|
Congratulations, your PR was merged at 91a8c93. Thanks a lot for contributing to OCA. ❤️ |
deeniiz
added a commit
to nuobit/odoo-addons
that referenced
this pull request
Apr 24, 2026
…ions bind_export in connector_extension performs cr.commit() to persist the binding immediately after the SAP HTTP PATCH succeeds. This is intentional: it prevents duplicate addresses being created in SAP on job retry (when the adapter's -2035 counter would increment AddressName to "(2)", "(3)" etc. for the same partner on each retry attempt). Since queue_job 16.0.2.13.2 (OCA/queue#892), the _prevent_commit guard raises RuntimeError on any cr.commit() inside a job. Setting allow_commit =True on the Job Function makes perform() run in a temporary env with a separate DB cursor: the commit is real but does not release the main cursor's queue_job row-lock, so there is no double execution risk. Post-migration updates the existing auto-created queue.job.function records for: - sapb1.binding - sapb1.res.partner - sapb1.sale.order - sapb1.sale.order.line - sapb1.product.product Refs: https://github.com/OCA/queue/wiki/Upgrade-warning:-commits-inside-jobs Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.
Replace Job | None with Optional[Job] and add typing import.
refs #891