تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
1 الرد
3857 أدوات العرض

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
مايو 24
1495
1
أكتوبر 23
3320
1
سبتمبر 25
2318
2
أغسطس 25
2737
2
يونيو 25
1206