Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
2 Trả lời
1532 Lượt xem

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?

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

Hi, 

You can see following for this:

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

Hope it helps,

Thanks

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

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

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
2
thg 7 25
1984
3
thg 7 25
2409
1
thg 7 25
1668
3
thg 11 24
361
4
thg 9 24
3200