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

I'm using Odoo 15! When I try "self.env.company" I get the same result as when I try "self.env.user.company_id". In other words, regardless of what company I choose in my Odoo environment, it picks the default company of my current user.



What could be the possible issue?

頭像
捨棄
最佳答案

Hi, 

You can see following for this:

https://youtu.be/GkNgc-fZO-I

Hope it helps,

Thanks

頭像
捨棄
最佳答案

Hi,

If you need to get the selected company in the company switcher, you can use the self.env.company .

Can you see if this works fine, assign default company for user as C1 and provide access to multiple companies: C1, C2,...

Now in the environment select the company as C2 and if you evaluate self.env.company id you will get/expected to be C2


Thanks

頭像
捨棄
相關帖文 回覆 瀏覽次數 活動
2
7月 25
1998
3
7月 25
2419
1
7月 25
1670
3
11月 24
361
4
9月 24
3205