Help

欢迎!

该社区面向专业人士和我们产品和服务的爱好者。
分享和讨论最好的内容和新的营销理念,建立您的专业形象,一起成为更好的营销人员。


0

How i can get Selected Company ID

Avatar
odoo
Avatar
Discard
2 Answers
0
Avatar
odoo
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
Discard
0
Avatar
odoo
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 

2 Comments
Avatar
Discard
Avatar
odoo
-

can i get currency_id like this ?

currency_id = user_id.currency_id

Avatar
odoo
-

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