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

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 ?

形象
丢弃
最佳答案

Hi Josef ,

Try,

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



Hope it helps,
Kiran K

形象
丢弃
编写者

This was the solution. Thank you so much!

相关帖文 回复 查看 活动
0
5月 24
1127
1
10月 23
2682
1
6月 25
2195
2
6月 25
504
1
6月 25
1272