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

[17.0] [MIG] base_multi_company: Migration to 17.0 #624

Merged
merged 91 commits into from
Jul 25, 2024

Conversation

rven
Copy link

@rven rven commented May 21, 2024

No description provided.

lasley and others added 30 commits May 21, 2024 12:40
* Create new module to provide base multi company logic and mixin
* Add deactivation by company mixin
* Add company_id/ids handling
* Add break after company is found
Squashed commits:
[854cc36] Increase test coverage
[770bd71] Revert hook view create back to model init
[40e803e] Fix apples and oranges
[7a4dfb4] Use registry correctly
[6e9f170] Switch company_id to computed & move company aliased view creation to post init hook
[faa4fc9] Remove active functionality
[fecfb59] Add explicit tests for active and inactive searches
* Revert "Revert hook view create back to model init"

This reverts commit 770bd71.

* [FIX] base_multi_company: Always create the view into a pre_init_hook to avoid error in log
Squashed commits:
[4c17d04] auto_join company_ids
…ch domain on company_id/company_ids (+1 squashed commit)

Squashed commits:
[fe161fe] [ADD] setup.py
- Test if a company is set in inverse method (+1 squashed commit)
Squashed commits:
[d670f30] [FIX] fix init hooks as company_id is not stored anymore
* Add implementation instructions to ReadMe
[FIX] Fix issue based on the computation of company_id for multi_company_abstract models

[FIX] Fix issue based on the computation of company_id for multi_company_abstract models

[FIX] Fix issue based on the computation of company_id for multi_company_abstract models

[FIX] Bad branch version pushed before

[FIX] Bad branch version pushed before

[FIX] manifest

Fix flake

Flake8 on OCA tests
Currently translated at 88.9% (8 of 9 strings)

Translation: multi-company-10.0/multi-company-10.0-base_multi_company
Translate-URL: https://translation.odoo-community.org/projects/multi-company-10-0/multi-company-10-0-base_multi_company/pt/
Odoo now checks if the user who creates the transient model is the same that is accessing
its data, so we need to create it with the same user.
Updated by Update PO files to match POT (msgmerge) hook in Weblate.
* Abstract model shouldn't have default for `company_ids`. It will be got by
  default `company_id` value.
* Record rule based on `company_id` makes the evaluation slower. Switch to `company_ids` field.
* Add `@api.depends` to `company_id` computation for proper refresh.
* Fix tests that were not correct but luckily previously suceeded. Now that other code has
  been removed, they have been uncovered.
Updated by Update PO files to match POT (msgmerge) hook in Weblate.
Updated by Update PO files to match POT (msgmerge) hook in Weblate.
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: multi-company-12.0/multi-company-12.0-base_multi_company
Translate-URL: https://translation.odoo-community.org/projects/multi-company-12-0/multi-company-12-0-base_multi_company/
Currently translated at 70.0% (7 of 10 strings)

Translation: multi-company-12.0/multi-company-12.0-base_multi_company
Translate-URL: https://translation.odoo-community.org/projects/multi-company-12-0/multi-company-12-0-base_multi_company/zh_CN/
@rven rven mentioned this pull request May 21, 2024
14 tasks
@pedrobaeza
Copy link
Member

/ocabot migration base_multi_company

@OCA-git-bot OCA-git-bot added this to the 17.0 milestone May 21, 2024
@rven rven force-pushed the 17.0-mig-base_multi_company branch 3 times, most recently from 94d5e1f to 503d1fb Compare May 21, 2024 14:23
@mohammedshahil
Copy link

I had a quick look at this and the domain seems to be not working properly, if there is no company set. I had to rewrite the domain to "['|', ('company_ids', '=', False), ('company_ids', 'in', company_ids)]" for it to work properly. I then had a look at the Odoo's code and Odoo also seems to use the one i gave for m2m in the iap module. @rven

@rven
Copy link
Author

rven commented Jun 1, 2024

I had a quick look at this and the domain seems to be not working properly, if there is no company set. I had to rewrite the domain to "['|', ('company_ids', '=', False), ('company_ids', 'in', company_ids)]" for it to work properly. I then had a look at the Odoo's code and Odoo also seems to use the one i gave for m2m in the iap module. @rven

I didn't change this domain, it has been updated within the migration of v16 91088f1

@pedrobaeza
Copy link
Member

pedrobaeza commented Jun 1, 2024

It's incorrect on v16. To be fixed. Please fix it here.

@rven rven force-pushed the 17.0-mig-base_multi_company branch from 503d1fb to e96231b Compare June 3, 2024 07:00
@rven
Copy link
Author

rven commented Jun 3, 2024

@mohammedshahil @pedrobaeza Can you recheck the module with this change?

@rven
Copy link
Author

rven commented Jun 5, 2024

@pedrobaeza Are you sure the domain was incorrect in v16? odoo/odoo@c18b9f4

@pedrobaeza
Copy link
Member

Yes, in what you put, the left part is a many2one, not a many2many. This was discovered in #628. The question is that m2m doesn't handle correctly the False value in the same list.

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.

LGTM 👍

@pedrobaeza
Copy link
Member

/ocabot merge nobump

@OCA-git-bot
Copy link
Contributor

On my way to merge this fine PR!
Prepared branch 17.0-ocabot-merge-pr-624-by-pedrobaeza-bump-nobump, awaiting test results.

@OCA-git-bot OCA-git-bot merged commit 23b3a1a into OCA:17.0 Jul 25, 2024
4 of 7 checks passed
@OCA-git-bot
Copy link
Contributor

Congratulations, your PR was merged at 6e2b1c2. 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.

None yet