Zum Inhalt springen
Menü
Sie müssen registriert sein, um mit der Community zu interagieren.
Diese Frage wurde gekennzeichnet
2 Antworten
2979 Ansichten

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
Verwerfen
Beste Antwort

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
Verwerfen
Autor

I want to pass search parameter from the method.

Beste Antwort

Hello Ankit,

Try this

from openerp.http import request

then in your function:

print request.session.db


Avatar
Verwerfen
Verknüpfte Beiträge Antworten Ansichten Aktivität
1
Dez. 16
3502
0
März 15
3678
0
Juli 16
5880
4
Dez. 24
30817
0
Jan. 23
1493