Odooers论坛

欢迎!

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


0

How i can get Selected Company ID

形象
odoo
形象
丢弃
2 答案
0
形象
odoo
最佳答案

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


形象
丢弃
0
形象
odoo
最佳答案

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 注释
形象
丢弃
形象
odoo
-

can i get currency_id like this ?

currency_id = user_id.currency_id

形象
odoo
-

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