Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
4 Trả lời
4337 Lượt xem

We have Odoo 12 (enterprise) on Ubuntu 18 running.


I want to force a database selection when a request comes from a certain domain (the webshop domain) 


So https://webshop.mydomain.com should only use the production "myproductiondb"


In /etc/odoo/odoo.conf I have set this:

server_wide_modules = base,web,dbfilter_from_header

proxy_mode = True


In Apache:

     ProxyRequests Off

     RequestHeader set X-Odoo-dbfilter "myproductiondb"


     #Redirect to ODOO

     ProxyPreserveHost On

     ProxyPass / http://localhost:8069/ retry=0

     ProxyPassReverse / http://localhost:8069/



However I still get redirected to webshop.mydomain.com/web/database/selector

If I add this in /etc/odoo/odoo.conf

dbfilter = myproductiondb

It works. But now it is always doing this, while I only want to force this on the webshop. So why is the RequestHeader functionality not working. 

Hope someone can help me

Thanks
Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

Hi Jurn:

There may be a simpler way to do this by using %d in the dbfilter setting in odoo.conf

Take a look at the 2nd example provided here:

https://www.odoo.com/documentation/12.0/setup/deploy.html#configuration-samples

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

list_db = false ?

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

Hi Jurn,

Facing exactly the same issue on Odoo 13.

What was the solution to your problem?

Thanks,

Varinder

Ảnh đại diện
Huỷ bỏ
Tác giả Câu trả lời hay nhất

Hi Paresh, 

Thanks! However does this work if the database name is "myproductiondb" and the domain "webshop.mydomain.com" (so no relation in name)?
Or does this automatically work when the system parameter web.url is set to  in the database 
myproductiondb?


Thanks

Ảnh đại diện
Huỷ bỏ

No. The name of the database should match the domain. You can duplicate and rename the database if you are still in the development phase. If you are already in production, you will need to assess the impact of changing the name of the database. For example, you may have backup scripts that have the database name hard coded in them.

Bài viết liên quan Trả lời Lượt xem Hoạt động
1
thg 3 15
4773
1
thg 8 24
1096
1
thg 3 15
5903
3
thg 7 21
8217
5
thg 8 15
55450