Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
1 ตอบกลับ
3296 มุมมอง

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.

 

อวตาร
ละทิ้ง