Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
2 Odpowiedzi
2991 Widoki

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


Awatar
Odrzuć
Najlepsza odpowiedź

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.

Awatar
Odrzuć
Autor

I want to pass search parameter from the method.

Najlepsza odpowiedź

Hello Ankit,

Try this

from openerp.http import request

then in your function:

print request.session.db


Awatar
Odrzuć
Powiązane posty Odpowiedzi Widoki Czynność
1
gru 16
3508
0
mar 15
3682
0
lip 16
5888
4
gru 24
30830
0
sty 23
1495