Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
1 ตอบกลับ
3847 มุมมอง

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!

Related Posts ตอบกลับ มุมมอง กิจกรรม
0
พ.ค. 24
1489
1
ต.ค. 23
3291
1
ก.ย. 25
2311
2
ส.ค. 25
2710
Controller not working แก้ไขแล้ว
2
มิ.ย. 25
1193