Skip to Content
Menu
This question has been flagged
2 Replies
11762 Views

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
Discard
Best Answer

Hi 

You can get selected compay_id form the context.

selected_companies = self.env['res.company'].browse(self._context.get('allowed_company_ids'))
Avatar
Discard
Best Answer

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
Discard