Skip to Content
Menu
This question has been flagged
2 Replies
7662 Views

Simple requirement:  When an anonymous user visits the website, I want it to default to a specific website/database so they don't have to choose the database before even seeing the site... which is a really bad experience, clearly.

However, I do want to have multiple databases that can be selected by users of Odoo when they log in (or are identified by the domain name used). 

I have tried setting the db_name in the configuration, which has no effect, other than to provide a default for module installations etc.

I have tried setting the dbfilter, as follows:

dbfilter=mydbname

 - This correctly selects the exact db, but hides all the others from the selector, and is not dynamic based on domain name, therefore I am really stuck with a single DB with this approach.

dbfilter=^%h$  (which is supposed to be the variable for the full host.domain.tld name)

 - This just does not work.  I have set my db name as:  domainname, domainname.tld (exactly as it appears in the browser) and domainname-tld (as per some tip in a community thread on this topic).  In every case, it asks me to create a new database. 

As I have a naked/bare domain (no www) I cannot use the %d variable, as this only provides the hostname part of the domain name.

I am using nginx and hosting odoo inside a docker container - the nginx proxy pass info set as such:

proxy_set_header X-Forwarded-Host $host;

proxy_set_header X-Forwarded-Server $host;

proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

proxy_pass http://prod-odoo:8069/;

So, I assume I am passing the hostname correctly. 

There appears no other way to make this work, but suggestions welcome.

Can you confirm a) is this possible, b) have I got my configuration correct, or c) is this a bug?

 

Avatar
Discard

Does anyone have any thoughts on this?  

Best Answer

Hi Damian,

Did you find a way around this? I'm facing a similar issue.

Thanx.

Avatar
Discard
Author

Hi Michel,

Unfortunately, no. I assume this is not possible in Odoo 9, despite it seeming like it should be, based on how that functionality is described. We will be rolling out Odoo 10 soon, so will check to see if this works in the latest release.

If you do figure out how to get it to work, I'd love to hear about it :)

Cheers,

Damian

After consulting Odoo, it turns out our approach is wrong and I was asking the wrong questions.

We are still in the start-up fase, but the multiple DB issue was already raising a lot of questions.

We have a test copy of our production DB on our production server.

Causing new users having to choose their DB, which we wanted to avoid.

The solution, as simple as it is logical : we should have only 1 database on the production server.

Looking back on this, I can’t see how I missed this.

There are a million reasons why you would want an isolated production environment, without testing stuff on it.

I guess, we got blind sighted because it is so simple to create a duplicate of the production DB and use the copy as a “production like test”.

I hope you can get a solution for your question.

Regards,

Michel

Related Posts Replies Views Activity
2
Sep 23
7389
3
Aug 21
15359
1
May 18
3739
11
Jul 24
96967
1
Dec 24
407