跳至內容
選單
此問題已被標幟
2 回覆
3006 瀏覽次數

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


頭像
捨棄
相關帖文 回覆 瀏覽次數 活動
1
12月 16
3513
0
3月 15
3690
0
7月 16
5896
4
12月 24
30841
0
1月 23
1496