v 13.0 Third Party 66
Required Apps Website (website)
Included Dependencies
Multi System Parameters (70 lines of code)
Multi-Brand Access Rules (14 lines of code)
Multi-Brand Mailing (264 lines of code)
Multi-Brand Backend (627 lines of code)
Lines of code 1056
Technical Name website_multi_company
LicenseOPL-1
Websitehttps://twitter.com/yelizariev
Also available in version v 12.0 v 11.0 v 10.0
You bought this module and need support? Click here!
Required Apps Website (website)
Included Dependencies
Multi System Parameters (70 lines of code)
Multi-Brand Access Rules (14 lines of code)
Multi-Brand Mailing (264 lines of code)
Multi-Brand Backend (627 lines of code)
Lines of code 1056
Technical Name website_multi_company
LicenseOPL-1
Websitehttps://twitter.com/yelizariev
Also available in version v 12.0 v 11.0 v 10.0

Real Multi Website

A module for missing Multi-Websites, Multi-Brand features

Key features:
  • Set website editors per website

Free Support

You will get free support and assistance in case of any issues

Need our service?

Contact us by email or fill out request form

  • apps@it-projects.info
  • https://www.it-projects.info/page/website.contactus
  • https://m.me/itprojectsllc
  • skype@it-projects.info
Tested on Odoo
13.0 community
Tested on Odoo
13.0 enterprise

Real Multi Website

Installation

Additional modules

Due to technical reasons some multi-website features are located in separate modules, install them depending on your needs:

Domain Names

You will be able to use any website domain names (not only subdomains), e.g. shop1.com, shop2.com, etc. In this case you need to setup DNS entries on your DNS hosting provider.

For example:

  • shop1.com:

    @   A   your_server_ip_address
    
  • shop2.com:

    @   A   your_server_ip_address
    

Web Server

Your webserver (e.g. Apache or Nginx) must pass header Host to odoo, otherwise there is no way to define which website is used. Required configuration for Nginx and Apache looks as following:

Nginx:

proxy_set_header Host $host;

Apache:

ProxyPreserveHost On

Single database deployment

No updates in odoo config is required if you use only one database.

Multi database deployment

For multi-database instance odoo has to know which database to use when handle new request without session information. There are two ways to do it:

  • Let user select database manually (bad user experience)
  • Take database depending on host name (prefered)

In the latter case dbfilter is usually used, though it's not flexible enough.

Using dbfilter parameter

For TESTING purpose you can use the following configuration:

  • dbfilter: ^%d$
  • database name: example
    • host names:
      • example.shop1.local
      • example.shop2.local
      • example.shop3.local

Patching http.py

For PRODUCTION deployment with websites on subdomains you can use following patch. You need to update odoo/http.py file as following:

# updated version of db_filter
def db_filter(dbs, httprequest=None):
    httprequest = httprequest or request.httprequest
    h = httprequest.environ.get('HTTP_HOST', '').split(':')[0]
    d, _, r = h.partition('.')
    t = r
    if d == "www" and r:
        d, _, t = r.partition('.')
    r = odoo.tools.config['dbfilter'].replace('%h', h).replace('%d', d).replace('%t', t)
    dbs = [i for i in dbs if re.match(r, i)]

Then you can use following configuration

  • dbfilter: ^%t$
  • database name: example.com
    • host names:
      • shop1.example.com
      • shop2.example.com
      • shop3.example.com
  • database name: example.org
    • host names:
      • shop1.example.org
      • shop2.example.org
      • shop3.example.org

Using dbfilter_from_header module

Most flexible way to deploy multi-database system is using dbfilter_from_header (check module description for installation instruction).

In short, you need to add special line to your webserver config (other webservers are supported too - see description of dbfilter_from_header):

Nginx:

proxy_set_header X-Odoo-dbfilter [your filter regex]

Apache:

Header add X-ODOO_DBFILTER [your filter regex]
RequestHeader add X-ODOO_DBFILTER [your filter regex]

Note, that you probably need to set usual db_filter to .*, because dbfilter_from_header module uses that filter first and then applies filter from header.

Example (we use top level domain .example due to copyright issues, but it could be any top level domains at any combinations):

  • dbfilter: .*

  • database name: software_business

    • host names:
      • miscrosoft-products.example
      • antivirus.example
      • android.antivirus.example
  • database name: delivery_business

    • host names:
      • pizzas.example
      • china-food.example
  • Nginx:

    server {
      listen 80;
      server_name miscrosoft-products.example antivirus.example android.antivirus.example;
    
      proxy_set_header Host $host;
      proxy_set_header X-Odoo-dbfilter ^software_business\Z;
    
      location /longpolling {
          proxy_pass http://127.0.0.1:8072;
      }
    
      location / {
          proxy_pass http://127.0.0.1:8069;
      }
    }
    
    server {
      listen 80;
      server_name pizzas.example china-food.example;
    
      proxy_set_header Host $host;
      proxy_set_header X-Odoo-dbfilter ^delivery_business\Z;
    
      location /longpolling {
          proxy_pass http://127.0.0.1:8072;
      }
    
      location / {
          proxy_pass http://127.0.0.1:8069;
      }
     }
    

Apache:

<VirtualHost *:80>
        ServerName miscrosoft-products.example antivirus.example android.antivirus.example

            ProxyPreserveHost On
            Header add X-ODOO_DBFILTER "software_business"
    RequestHeader add X-ODOO_DBFILTER "software_business"

            ProxyPass /   http://127.0.0.1:8069/
            ProxyPassReverse /   http://127.0.0.1:8069/

            ProxyPass /longpolling/   http://127.0.0.1:8072/longpolling/
            ProxyPassReverse /longpolling/   http://127.0.0.1:8072/longpolling/

</VirtualHost>

<VirtualHost *:80>
    ServerName pizzas.example china-food.example

            ProxyPreserveHost On
            Header add X-ODOO_DBFILTER "delivery_business"
    RequestHeader add X-ODOO_DBFILTER "delivery_business"

    ProxyPass /   http://127.0.0.1:8069/
            ProxyPassReverse /   http://127.0.0.1:8069/

            ProxyPass /longpolling/   http://127.0.0.1:8072/longpolling/
            ProxyPassReverse /longpolling/   http://127.0.0.1:8072/longpolling/

</VirtualHost>

Odoo.sh deployment

In the manager of your domain name registrar you need to add CNAME records for your domains (subdomains), for example:

  • Create a CNAME record shop1.example.org pointing to <yourdatabase>.odoo.com
  • Create a CNAME record shop2.example.org pointing to <yourdatabase>.odoo.com
  • Create a CNAME record example.com pointing to <yourdatabase>.odoo.com

Similar for dev and staging database, but use corresponding domain in odoo.com, e.g. mywebsite-master-staging-12345689.dev.odoo.com

Translation issue

Check this section if you use translations in odoo.

Odoo may have wrong translations, which leads to the error Translation is not valid. You need either fix the translations or apply following workaround:

  • open file odoo/addons/base/ir/ir_translation.py

  • comment out @api.constraints... near def _check_value, that is you shall get something like this (pay attention to # symbol):

    #@api.constrains('type', 'name', 'value')
    def _check_value(self):
        for trans in self.with_context(lang=None):
    

Configuration

  • Enable technical features
  • At [[ Settings ]] >> Users >> Users menu and activate Multi Companies, set Allowed Companies, setup Editor on websites
  • Use menu [[ Website ]] >> Configuration >> Websites and [[ Website ]] >> Configuration >> Settings >> Website to setup websites
Odoo Proprietary License v1.0

This software and associated files (the "Software") may only be used (executed,
modified, executed after modifications) if you have purchased a valid license
from the authors, typically via Odoo Apps, or if you have received a written
agreement from the authors of the Software (see the COPYRIGHT file).

You may develop Odoo modules that use the Software as a library (typically
by depending on it, importing it and using its resources), but without copying
any source code or material from the Software. You may distribute those
modules under the license of your choice, provided that this license is
compatible with the terms of the Odoo Proprietary License (For example:
LGPL, MIT, or proprietary licenses similar to this one).

It is forbidden to publish, distribute, sublicense, or sell copies of the Software
or modified copies of the Software.

The above copyright notice and this permission notice must be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.

Please log in to comment on this module

  • The author can leave a single reply to each comment.
  • This section is meant to ask simple questions or leave a rating. Every report of a problem experienced while using the module should be addressed to the author directly (refer to the following point).
  • If you want to start a discussion with the author or have a question related to your purchase, please use the support page.