Se rendre au contenu
Menu
Cette question a été signalée
2 Réponses
12132 Vues

Hi
How can i get  Currently active company ids in Odoo 13 (case of multi company we can select multiple companies from the company list, right).



So how can i get these selected company ids in a function.

Avatar
Ignorer
Meilleure réponse

Hi 

You can get selected compay_id form the context.

selected_companies = self.env['res.company'].browse(self._context.get('allowed_company_ids'))
Avatar
Ignorer
Meilleure réponse

def _get_my_default_company(self):
      company_ids = self.env.user.company_id.id

you can then use the ids to retrieve any information from the res.company table

    
Avatar
Ignorer