Skip to Content
Menu
This question has been flagged
2 Replies
2990 Views

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


Avatar
Discard
Best Answer

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.

Avatar
Discard
Author

I want to pass search parameter from the method.

Best Answer

Hello Ankit,

Try this

from openerp.http import request

then in your function:

print request.session.db


Avatar
Discard
Related Posts Replies Views Activity
1
Dec 16
3508
0
Mar 15
3681
0
Jul 16
5886
4
Dec 24
30829
0
Jan 23
1495