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

I have setup 3 companies,

And for user = Admin, all 3 companies are 'allowed', the default company is company 1.

I tried several scripts inside the Controller but none of them could return the correct value of the current company displayed on the upper right side of the windows.

user = request.env['res.users'].sudo.browse(request.uid)

current_company = user.company_id.name

but it always points to the user's default company (in this case id=1) even if i change the company on the top-right corner.

Please help. Thank you Odooers!

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
1
thg 6 23
2385
1
thg 8 22
3249
0
thg 5 22
2991
1
thg 4 21
5751
0
thg 2 25
1250