Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
2 Odpowiedzi
12111 Widoki

Image Privew

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

Need current Company ID which is selected at the top 

Awatar
Odrzuć
Najlepsza odpowiedź

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


Awatar
Odrzuć
Najlepsza odpowiedź

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 

Awatar
Odrzuć
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.

Powiązane posty Odpowiedzi Widoki Czynność
2
lip 25
1808
3
lip 25
2232
1
lip 25
1518
3
lis 24
361
4
wrz 24
3117