How to setup multiple websites in Odoo V8
5 March, 2021 by
How to setup multiple websites in Odoo V8
Administrator
| No comments yet


Odoo’s Lead Developer responds to this question (Please note that this is a very technical feature and is not yet easy to configure nor is it documented how to do it.)

Post 1:
Multi website was already planned since the first commit, it was just hard-coded to 1 in that commit. In saas-6 and master multi-website is supported for the 8.0 branch there is a non-official module with a backport of the feature in odoo-extra

https://github.com/odoo/odoo-extra/tree/8.0/website_multi

Post 2:
The actual magic is here:
https://github.com/odoo/odoo/tree/saas-6/addons/website/models/website.py#L386 in v8, 1 is hard-coded instead.

There is another piece of magic, the one that resolve template name, instead of using xmlids in 8.0 we now use a key field on ir.ui.view and there is an optional website_id column on ir.ui.view.

https://github.com/odoo/odoo/tree/saas-6/addons/website/models/ir_ui_view.py#L156

Post 3:
The documentation about it is non-existent, it works like virtual domains you odoo will select the website that match the right domain based on the Host: header.

Then if want to have a different page you can duplicate the ir.ui.view template (so both have the same key) and set a different website_id for each one.

So that you can choose which template you want to differentiate and which ones should stay common.

To display different product for example you need to create an additional public user (on the second website (field user_id)) and use record rules.

This is a very advanced functional topic, like multi-company.

Sign in to leave a comment