Se rendre au contenu
Menu
Cette question a été signalée
1 Répondre
2085 Vues

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?

Avatar
Ignorer

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

Meilleure réponse

Hi,

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

Hope it helps


Avatar
Ignorer
Publications associées Réponses Vues Activité
2
sept. 25
2073
1
août 25
1685
1
août 25
661
0
juil. 25
792
0
juil. 25
1324