Skip to Content
Menu
You need to be registered to interact with the community.
This question has been flagged
1 Odgovori
3787 Prikazi

Im building a customized page in the customer portal as a controller. I need to find the logged in's user corresponding event.booth . This is the query that i perform:


stand = http.request.env['event.booth'].search([('partner_id', '=', request.uid)])

i noticed that partner_id and uid are not the same so now i am wondering how to compare the partner id to the user id in order to get the corresponding record?

I have tried comparing the names using partner_id.name and uid.name

I have also tried getting the linked partner_id from the user by comparing request.uid.name and partner_id

Unfortunately none of the above worked out.

How i can i compare the user id and the partner_id ?

Avatar
Opusti
Best Answer

Hi Josef ,

Try,

stand = http.request.env['event.booth'].search([('partner_id', '=', request.env.user.partner_id.id)])



Hope it helps,
Kiran K

Avatar
Opusti
Avtor

This was the solution. Thank you so much!

Related Posts Odgovori Prikazi Aktivnost
0
maj 24
1453
1
okt. 23
3211
1
sep. 25
2241
2
avg. 25
2670
2
jun. 25
1131