跳至内容
菜单
此问题已终结
2 回复
12151 查看

Image Privew

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

Need current Company ID which is selected at the top 

形象
丢弃
最佳答案

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


形象
丢弃
最佳答案

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 

形象
丢弃
编写者

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.

相关帖文 回复 查看 活动
2
7月 25
1962
3
7月 25
2382
1
7月 25
1640
3
11月 24
361
4
9月 24
3184