Skip to content

Conversation

@LauraCForgeFlow
Copy link
Contributor

@LauraCForgeFlow LauraCForgeFlow commented Nov 27, 2025

Before this commit, we could have wrong access errors on records. As an example, if we had a user with enabled companies A and C (being A the main company) and a record with enabled companies B and C, we would get and access error.

That's because the company_id for the record was set to B (since it did not match with the user's main company, A, it took the first of the enabled companies for the record). But it should be set to C, because it's the first common company between the user and the record, and that would allow us to access the record without any error. Also added new use cases in the testing to check this behavior. Without the code changes in the commit, the test fails.

@OCA-git-bot
Copy link
Contributor

Hi @pedrobaeza,
some modules you are maintaining are being modified, check this out!

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.

Code LGTM

Copy link
Contributor

@ArnauCForgeFlow ArnauCForgeFlow left a comment

Choose a reason for hiding this comment

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

LGTM!

@OCA-git-bot
Copy link
Contributor

This PR has the approved label and has been created more than 5 days ago. It should therefore be ready to merge by a maintainer (or a PSC member if the concerned addon has no declared maintainer). 🤖

@LauraCForgeFlow LauraCForgeFlow force-pushed the 18.0-fix-base_multi_company-company_id_use_all_common_companies branch from 9f75ff5 to 48caf91 Compare December 6, 2025 19:36
@LauraCForgeFlow LauraCForgeFlow force-pushed the 18.0-fix-base_multi_company-company_id_use_all_common_companies branch 2 times, most recently from 3dbc618 to 1de1ecc Compare December 8, 2025 22:58
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.

5 participants