콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다
2 답글
3037 화면

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
3544
0
3월 15
3723
0
7월 16
5910
4
12월 24
30872
0
1월 23
1505