跳至內容
選單
此問題已被標幟
1 回覆
2040 瀏覽次數

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


頭像
捨棄
相關帖文 回覆 瀏覽次數 活動
2
9月 25
1994
1
8月 25
1635
1
8月 25
618
0
7月 25
758
0
7月 25
1296