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

Hi all,

Here i want to do Modify db_filter method ih openerp->http.py without overwrite in original file? how can i done this? please let me know...!

Thanks in advance....

아바타
취소
베스트 답변

Apply the technique of monkey patching in Python:

in your addon:

from openerp import http


def db_filter(dbs, httprequest=None):
    <...>

http.db_filter = db_filter

What happens here, is that you replace the function reference from the original\
 module with your own function reference.

 

아바타
취소