[16.0][IMP] purchase_sale_stock_inter_company: enforce PO company in move vals#943
Open
JasminSForgeFlow wants to merge 1 commit intoOCA:16.0from
Open
[16.0][IMP] purchase_sale_stock_inter_company: enforce PO company in move vals#943JasminSForgeFlow wants to merge 1 commit intoOCA:16.0from
JasminSForgeFlow wants to merge 1 commit intoOCA:16.0from
Conversation
AaronHForgeFlow
approved these changes
Feb 12, 2026
Contributor
AaronHForgeFlow
left a comment
There was a problem hiding this comment.
Functional + code
BTW this needs forward port in case of merge
Contributor
|
@carlos-lopez-tecnativa I would appreciate your review here. Thank you. |
Contributor
carlos-lopez-tecnativa
left a comment
There was a problem hiding this comment.
Sorry, but I do not completely understand the issue.
I noticed that Odoo enforces the order’s company when the picking is created, so all the code involved must be executed with the correct company.
https://github.com/odoo/odoo/blob/4840a6639deb171c28ae14b0269d420aa1503860/addons/purchase_stock/models/purchase.py#L254
Otherwise, if this is considered an issue, why don’t you create a PR for Odoo?
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.
When a PO line is processed from another current company, preparing stock move values could run in the wrong company context.
Switch to the purchase order company before calling super so company-dependent values are computed consistently.