Odoo Help

Welcome!

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

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

 

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

2 follower(s)

Stats

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