OCA / multi-company

GNU Affero General Public License v3.0
101 stars 281 forks source link

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

Closed rven closed 2 months ago

pedrobaeza commented 4 months ago

/ocabot migration base_multi_company

mohammedshahil commented 4 months ago

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 commented 4 months ago

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 https://github.com/OCA/multi-company/commit/91088f113d57eb13d994eb85896d2366edfa8bba

pedrobaeza commented 4 months ago

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

rven commented 4 months ago

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

rven commented 4 months ago

@pedrobaeza Are you sure the domain was incorrect in v16? https://github.com/odoo/odoo/commit/c18b9f44be3d666ca1e082807a2fdfc7ef2049d2

pedrobaeza commented 4 months ago

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.

pedrobaeza commented 2 months ago

/ocabot merge nobump

OCA-git-bot commented 2 months ago

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 commented 2 months ago

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