コンテンツへスキップ
メニュー
この質問にフラグが付けられました
2 返信
3029 ビュー

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
3523
0
3月 15
3695
0
7月 16
5899
4
12月 24
30846
0
1月 23
1501