Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
1 Odpowiedz
1830 Widoki

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?

Awatar
Odrzuć

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

Najlepsza odpowiedź

Hi,

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

Hope it helps


Awatar
Odrzuć
Powiązane posty Odpowiedzi Widoki Czynność
1
sie 25
341
0
lip 25
528
0
lip 25
1170
1
maj 25
1653
1
kwi 25
1712