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

I want to pass database field name in my method as search parameter. How can I do it? Like below:

def my_method(self, search_parameter):

          return self.partner_id.search_parameter


อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

Here the question would arise from where you will call this method?

Do you want the search to be on the view?

For extra parameters it is always advisable to use context you can pass any parameter as a key in context and you can use context in all the methods of odoo.

So instead of a separate parameter you can pass it as a key in context.

Hope this would help.

อวตาร
ละทิ้ง
ผู้เขียน

I want to pass search parameter from the method.

คำตอบที่ดีที่สุด

Hello Ankit,

Try this

from openerp.http import request

then in your function:

print request.session.db


อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
1
ธ.ค. 16
3519
0
มี.ค. 15
3690
0
ก.ค. 16
5897
4
ธ.ค. 24
30843
0
ม.ค. 23
1497