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

About dbfilter with -

By
YannickB
on 5/23/14, 10:22 AM 1,100 views

Hello everybody,

I need some help with dbfilter, the tool on odoo server which redirect to the correct database depending of the web domain. I already manage a complex case but there is still a case I can't make work.

Domain : test.domain.org

Database : oct_test_domain_org

dbfilter : ^oct_%h$

This one works perfectly, but I have another case :

Domain : test-test.domain.org

Database : oct_test_test_domain_org

dbfilter : ^oct_%h$

This one doesn't work, I believe - aren't replaced by _, contrary to the dot.

Same problem if there is a - in the domain :

Domain : test.yolo-consulting.net

Database : oct_test_yolo_consulting_net

dbfilter : ^oct_%h$

What should I do?

0
YannickB
On 6/10/14, 4:48 AM

I had no choice but to replace

    r = openerp.tools.config['dbfilter'].replace('%h', h).replace('%d', d)


by

    r = openerp.tools.config['dbfilter'].replace('%h', h).replace('%d', d).replace('-','_')

in server/openerp/http.py. Not really beautiful but at least it works.

If someone know a way to replace - by _ directly in the regular expression, it would be great.

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

1 follower(s)

Stats

Asked: 5/23/14, 10:22 AM
Seen: 1100 times
Last updated: 3/16/15, 8:10 AM