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

[16.0][IMP] partner_multi_company: prevent inconsistencies between user and partner #670

Merged
merged 2 commits into from
Jul 24, 2024

Conversation

ArnauCForgeFlow
Copy link

fwport #667

@OCA-git-bot
Copy link
Contributor

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

Copy link
Contributor

@LoisRForgeFlow LoisRForgeFlow left a comment

Choose a reason for hiding this comment

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

Ty

@LoisRForgeFlow
Copy link
Contributor

cc @pedrobaeza

@pedrobaeza pedrobaeza added this to the 16.0 milestone Jul 24, 2024
Comment on lines +4 to +5
# pylint: disable=W8150
from odoo.addons.partner_multi_company import hooks
Copy link
Member

Choose a reason for hiding this comment

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

We can do it here correctly:

Suggested change
# pylint: disable=W8150
from odoo.addons.partner_multi_company import hooks
from ...hooks import fix_user_partner_companies

Copy link
Author

Choose a reason for hiding this comment

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

Hello @pedrobaeza ,

I attempted to use the following import statement: from ...hooks import fix_user_partner_companies, but I encountered the following error:
ImportError: attempted relative import with no known parent package.

I reviewed other modules that utilize functions from hooks in their migration scripts, and they all employ absolute imports, disabling pylint. Perhaps you have encountered this error before and have found a solution?

Copy link
Member

Choose a reason for hiding this comment

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

OK, don't worry. Let's go this way. Maybe the migration manager is not doing imports 100% Python compatible.

Copy link
Member

@pedrobaeza pedrobaeza left a comment

Choose a reason for hiding this comment

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

/ocabot merge nobump

@OCA-git-bot
Copy link
Contributor

This PR looks fantastic, let's merge it!
Prepared branch 16.0-ocabot-merge-pr-670-by-pedrobaeza-bump-nobump, awaiting test results.

@OCA-git-bot OCA-git-bot merged commit ce1aaf4 into OCA:16.0 Jul 24, 2024
5 of 7 checks passed
@OCA-git-bot
Copy link
Contributor

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

@LoisRForgeFlow LoisRForgeFlow deleted the 16.0-imp-partner_multi_company branch July 24, 2024 14:47
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