0
5 答案
0
最佳答案
env.context['allowed_company_ids'] and env.context['allowed_company_ids'][0]
allowed_company_ids is a list of integers representing the ID of each Company:
Example 1 -
env.context['allowed_company_ids'] = [1,2,3]
env.context['allowed_company_ids'][0] = 1
Example 2 -
env.context['allowed_company_ids'] = [2,1,3]
env.context['allowed_company_ids'][0] = 2
0
最佳答案
Hello,
You have to try this domain [('company_id', 'in', company_ids)]
You can get active company ids in company_ids.
6
注释
Sorry i've tried that, but company_ids is related from self.env.companies.ids and it showing full of Allowed Companies as the picture above, not current company.
http://i.imgur.com/W2YlCur.png
0
最佳答案
Hello,
You can get current company from self.env.user.company_id. Company id will change according to the selection in the company switcher.
Thank you
self.env.context.get('company_id')
Why not get the company in context ?
Derick: how did you use self.env.context.get('company_id') in domain of record rule?