Skip to content

Conversation

@aleuffre
Copy link
Contributor

@aleuffre aleuffre commented Dec 1, 2025

This commit fixes an issue where, if there is only one warehouse visible to the user and that warehouse has no Operating Unit (so it's available for all regardless of OU), PO creation fails with an error.

In case of multiple warehouses being available (with and without OUs) the one with the OU is preferred and used over the others.

This commit fixes an issue where, if there is only one warehouse visible
to the user and that warehouse has no Operating Unit (so it's available
for all regardless of OU), PO creation fails with an error.

In case of multiple warehouses being available (with and without OUs)
the one with the OU is preferred and used over the others.
Copy link

@francesco-ooops francesco-ooops left a comment

Choose a reason for hiding this comment

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

Functional ok!

@AaronHForgeFlow
Copy link
Contributor

@aleuffre Typically there is no warehouse without operating unit in the company and I think the OU should be mandatory in the warehouse. But being the code in stock_operating_unit as it is, I am ok with this improvement. Would you do the forward port when merged?

@aleuffre
Copy link
Contributor Author

@AaronHForgeFlow Thank you for reviewing this. Of course I will do the forward ports.

@AaronHForgeFlow
Copy link
Contributor

/ocabot merge patch

@OCA-git-bot
Copy link
Contributor

What a great day to merge this nice PR. Let's do it!
Prepared branch 14.0-ocabot-merge-pr-820-by-AaronHForgeFlow-bump-patch, awaiting test results.

@OCA-git-bot OCA-git-bot merged commit 9f52270 into OCA:14.0 Dec 23, 2025
7 checks passed
@OCA-git-bot
Copy link
Contributor

Congratulations, your PR was merged at f328a80. Thanks a lot for contributing to OCA. ❤️

@aleuffre aleuffre deleted the 14.0-purchase-warehouse-ou branch December 23, 2025 08:46
@aleuffre
Copy link
Contributor Author

I checked, and the onchange method I'm changing here is not present in higher versions of the module.

I'll do a quick functional check to see if the problem exists in higher versions, but it may be that forward porting is not even needed.

@aleuffre
Copy link
Contributor Author

Yes, stock is not even a dependency of the module in higher versions, so this change can't be forward-ported.

@AaronHForgeFlow
Copy link
Contributor

ok, thank you for checking. There is a purchase_stock_operating_unit module, but looking at the code it seems it does not have this issue.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants