İçereği Atla
Menü
Bu soru işaretlendi
2 Cevaplar
12130 Görünümler

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
Vazgeç
En İyi Yanıt

Hi 

You can get selected compay_id form the context.

selected_companies = self.env['res.company'].browse(self._context.get('allowed_company_ids'))
Avatar
Vazgeç
En İyi Yanıt

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
Vazgeç