Меню

Допомога

1

How to get current company_id in multi company in odoo 13

Avatar
Haresh Kansara

Hello Odooers,

I have enabled multi company mode, so i can be able to switch to any company which i have access.

But i am fetching current company_id in python and it's giving me default company. Also i have noticed few points:

- I can be able to select more than one company to switch (which is not possible in odoo 12)

- Whenever i switch to any company then my active company_id is not changing.

Can anyone suggest me how to get current company_id in multicompany in odoo13


2 Коментарі
Аватар
Відмінити
Avatar
subbarao
-

try with

self.env.company

Avatar
Jose Gpe Osuna
-

self.env.company worked for me

4 Відповіді
1
Avatar
MING
Найкраща відповідь

Hi,

You can do this

company_id = self.env.company.id

Аватар
Відмінити
1
Avatar
Muhammad Anees
Найкраща відповідь
company = self.env.user.company_id
Аватар
Відмінити