This question has been flagged
1 Reply
3605 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?

Avatar
Discard
Author Best Answer

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.

Avatar
Discard