Odoo Help

17 Answers

swapnil wagh

--swapnil wagh--
| 6 5 8
Pune, India
--swapnil wagh--

My name is Swapnil A. Wagh. I studied Master Of computer Science and work as a Software Engineer. I’m a technology enthusiast and always eager to learn new and exciting technologies. I’m constantly looking for innovative solutions to age-old problems that push the limits of what we conceive to be possible.

swapnil wagh
10/11/14, 4:52 AM

Hi Anil,

If you are working on local machine you should edit /etc/hosts with something like this: foo.localhost bar.localhost

where foo and bar are the db names.

Your virtual host file should look like this:

<VirtualHost *:80>

ServerName localhost

ServerAlias *.localhost // Use this if you want dbfillter on subdomain

ErrorLog /var/log/openerp/openerp-error.log

CustomLog /var/log/openerp/openerp-access.log combined

<Proxy *>

Order deny,allow

Allow from all


ProxyRequests Off

ProxyPass / http://localhost:8069/

ProxyPassReverse / http://localhost:8069/

ProxyVia On

LogLevel warn


After that  write dbfilter = ^%d$ in your openerp/tools/config.py file. After that restart apache2 and openerp.

In case you are doing all this on VPS and you bough a domain from domian provider, then you dont need to edit/etc/hosts file.

You can read a blog post for more information : http://goo.gl/1Ub8sc

Anil R. Kesariya (AKE)
10/12/14, 5:32 AM

Hello Swapnil Thank I appreciate response. I have followed your step but couldn't achieved my requirements. Its redirect me to create new database page in any domain.

Anil R. Kesariya (AKE)
10/13/14, 12:42 AM

@vee I already have more than two database. I don't want to config the openerp with wsgi. I have applied the filter pattern inside the config.py file. thanks for your comment.

swapnil wagh
10/13/14, 2:14 AM

@Anil Can you give me some more details for better understanding your issue, Are you working on local machine? Can you share your Apache configuration and openerp configuration?

Anil R. Kesariya (AKE)
10/13/14, 2:18 AM

@Swapnil Yes I am working on local machine. I have gone through all the step you mention. I can login through applied domain on virtual host. only remaining portion is to set sub domain for database.

swapnil wagh
10/14/14, 5:17 AM

@Anil, did you create two entries like foo.localhost bar.localhost replace foo and bar with your two database names, on local you can't use serverAlise for subdomain, use foo.localhost.com as servername then change db-filter in openerp/tools/config.py to %d. It should work I personally when I deploy openerp.

Anil R. Kesariya (AKE)
10/15/14, 1:33 AM

@sapanil. Previously i used server alias for sub domain. I replaced with the specific subdomain. still having same screen of manage database.

swapnil wagh
10/15/14, 9:36 AM

Do you really have a database on server please check the db user might be you have db but the owner is different than what you have in openerp config, odoo redirect you to database manager page only when you don't have db single db created on server.

On Wed, Oct 15, 2014 at 11:03 AM, Anil Kesariya <a.kesariya.serpentcs@mail.odoo.com> wrote:

@sapanil. Previously i used server alias for sub domain. I replaced with the specific subdomain. still having same screen of manage database.

Anil Kesariya
Sent by Odoo Inc. using Odoo about Forum Post False

Anil R. Kesariya (AKE)
10/15/14, 9:50 AM

@swapnil I am not using service file to start openerp server. my openerp server is running manually.

Anil R. Kesariya (AKE)
10/16/14, 2:04 AM

@swapnil I have gone through the main db filter method which is defined in openerp/http.py . In that method it using the httprequest.environ.get('HTTPHOST', '').split(':')[0] which should return the domain passed on browser. instead domain i am getting the ip address and this value is manipulated get database. instead i modified the method and applied HTTP_X_FORWARDED_HOST instead HTTP_HOST h = httprequest.environ.get('HTTP_X_FORWARDED_HOST', '').split(':')[0] than it returns me the exact domain name eg. subdomain.localhost.com so it filter the correct data and return the filtered database list and works well. is it correct method to modified the code of odoo? or am I forgot anything to configure?

swapnil wagh
10/16/14, 8:25 AM

@Anil What you did is also ok, but when we use %d for db-filter in configuration it works, but as its filter the database it matches the subdoamin means if you have db like anil1 , anil2 and odoo and you use anil.domain.com it will show both db starts with anil except odoo in dropdown. So what you did is correct to get out from this issue. If you need any help from me I can help you to solve your subdomain issue.

Anil R. Kesariya (AKE)
10/17/14, 12:54 AM

Thanks sure.

5/28/15, 10:56 AM

Hi all,

May be this help you.

We find a solution for use %h and subdomain, create your db in replace '.' by '-'.

Example : for the domaine erp.pharmacy.com, create db erp-pharmacy-com

And in your file .conf, at line dbfilter, write this : dbfilter = %h

Works for Odoo v8

12/7/17, 5:17 AM

Header add X-ODOO_DBILTER "db-name"

RequestHeader add X-ODOO_DBFILTER "db-name"

please add these in apache2 configuration file to filter database

Shivam Mahajan
12/18/15, 1:11 AM

Can you please    tell me how to configure multi domains foe multi companies in odoo9.........the help would be appreciated

Ask a Question
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.

Odoo Training Center

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

Test it now