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

[13.0][14.0] mis_builder : Don't supports concurrent multicompany selection #379

Closed
carlosdauden opened this issue Sep 8, 2021 · 2 comments

Comments

@carlosdauden
Copy link

This domain prevents the selection of several companies according to the use of concurrent multicompany implemented as of v13:

domain="[('id', 'child_of', company_id)]"

Simply change...
¿Can be removed this domain?

More ambitious change...

Given the new scenario, can we consider keeping only one of the fields company (query_company_ids) and remove others (company_id and company_ids)?

@api.depends("multi_company", "company_id", "company_ids")
def _compute_query_company_ids(self):
for rec in self:
if rec.multi_company:
rec.query_company_ids = rec.company_ids or rec.company_id
else:
rec.query_company_ids = rec.company_id

@api.onchange("company_id", "multi_company")
def _onchange_company(self):
if self.company_id and self.multi_company:
self.company_ids = self.env["res.company"].search(
[("id", "child_of", self.company_id.id)]
)
else:
self.company_ids = False

@sbidoul
Copy link
Member

sbidoul commented Sep 21, 2021

@carlosdauden can you please test #374 and see if it does what you need ?

@carlosdauden
Copy link
Author

Improved in #374

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants