Odoo Help

0

how to Modify db_filter method in openerp->http.py without overwrite in original file?

By
Jo
on 2/19/15, 1:08 AM 826 views

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....

1
Stefan Rijnhart
On 2/19/15, 3:15 AM

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.

 

About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

Register

Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

2 follower(s)

Stats

Asked: 2/19/15, 1:08 AM
Seen: 826 times
Last updated: 3/16/15, 8:10 AM