Skip to Content
Menú
This question has been flagged
2 Respostes
12088 Vistes

Image Privew

i want to get current company id not user default company id ..

Need current Company ID which is selected at the top 

Avatar
Descartar
Best Answer

Hi,

You can get current company from self.env.user.company_id. Company id will change according to the selection in the company switcher.

Thank you


Avatar
Descartar
Best Answer

HI,

You can get current user id using 

user_id = self.env.user

and you want to user company than use 

company_id = user_id.company_id

I think work for you

THANKS 

Avatar
Descartar
Autor

can i get currency_id like this ?

currency_id = user_id.currency_id

Yes, you can get using dot notation as well as the search method.

Related Posts Respostes Vistes Activitat
2
de jul. 25
1765
3
de jul. 25
2148
1
de jul. 25
1474
3
de nov. 24
361
4
de set. 24
3079