跳至内容
菜单
此问题已终结
1 回复
1932 查看

Hey all,

i'm trying to get the currently selected company in a multi-company environment.

I've tried using 

self.env.user.company_id

But this gives me the user's default company.

I've also tried using the _context to get allowed_company_ids but this gives me a list that I can't use


Any help?

形象
丢弃

Does not work can you share with model code for example?

最佳答案

Hi,

You can get the currently selected company in a multi-company environment by self.env.context.get('allowed_company_ids')

Hope it helps


形象
丢弃
相关帖文 回复 查看 活动
1
8月 25
1558
1
8月 25
521
0
7月 25
675
0
7月 25
1243
1
5月 25
1760