Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[15.0][FW][FIX] operating_unit: default operating unit more multi-company friendly #643

Merged
merged 1 commit into from
Jan 10, 2024

Conversation

aleuffre
Copy link
Contributor

@aleuffre aleuffre commented Jan 10, 2024

FW of #642

This PR fixes an issue with the method operating_unit_default_get where it would return an operating unit even for a company that was not active, which would cause all sorts of issues

Steps to reproduce on runboat,
taking as example purchase_operating_unit:

  • User has a default ou belonging to Company 1
  • Switch to Company 2 (make sure Company 1 is not active at all)
  • Try to create a Purchase Order

The issue arises because the operating_unit field is pre-compiled on the PO with an Operating Unit whose company is inactive, and the onchanges cannot find or access related data.

This PR fixes an issue with the method operating_unit_default_get
where it would return an operating unit even for a company that was
not active, which would cause all sorts of issues

Steps to reproduce on runboat,
taking as example purchase_operating_unit:

- User has a default ou belonging to Company 1
- Switch to Company 2 (make sure Company 1 is not active at all)
- Try to create a Purchase Order

The issue arises because the operating_unit field is pre-compiled
on the PO with an Operating Unit whose company is inactive,
and the onchanges cannot find or access related data.
@aleuffre aleuffre changed the title [FIX] operating_unit: default operating unit more multi-company friendly [15.0][FW][FIX] operating_unit: default operating unit more multi-company friendly Jan 10, 2024
@AaronHForgeFlow
Copy link
Contributor

/ocabot merge patch

Merging to keep branches even

@OCA-git-bot
Copy link
Contributor

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

@OCA-git-bot OCA-git-bot merged commit 3a33745 into OCA:15.0 Jan 10, 2024
6 checks passed
@OCA-git-bot
Copy link
Contributor

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

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.

3 participants