Skip to content

[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
ForgeFlow:purchase_sale_stock_inter_company
Open

[16.0][IMP] purchase_sale_stock_inter_company: enforce PO company in move vals#943
JasminSForgeFlow wants to merge 1 commit intoOCA:16.0from
ForgeFlow:purchase_sale_stock_inter_company

Conversation

@JasminSForgeFlow
Copy link
Contributor

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.

Copy link
Contributor

@AaronHForgeFlow AaronHForgeFlow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Functional + code

BTW this needs forward port in case of merge

@AaronHForgeFlow
Copy link
Contributor

@carlos-lopez-tecnativa I would appreciate your review here. Thank you.

Copy link
Contributor

@carlos-lopez-tecnativa carlos-lopez-tecnativa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants