Odoo-Infrastructure

Odoo-Infrastructure is an application developed by the Center of Research and Development company. It is the client addon for the yodoo.systems.

First, let's make the configuration of Odoo and Nginx.

Odoo Configuration

Set up Odoo configuration file (/your_odoo_directory/conf/odoo.cong):

server_wide_modules = base,web,yodoo_client

yodoo_token = Your_random_token

db_filter = ^%h$

Nginx configuration

Set up wildcard domains in the nginx configuration file as shown below:

upstream test-paas {
        server localhost:8069 weight=1 fail_timeout=2000s;
}

upstream test-paas_longpolling {
        server localhost:8072 weight=1 fail_timeout=300s;
}

server {
    listen   0.0.0.0:80;
    server_name  *.test-paas.yodoo.int;

    #-----------------------------------------------------------------------
    access_log  /var/log/nginx/test-paas.access.log;
    error_log   /var/log/nginx/test-paas.error.log;
    #-----------------------------------------------------------------------

    # set headers
    proxy_set_header Host $host;
    proxy_set_header X-Forwarded-Proto $scheme;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Forward-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Real-IP $remote_addr;

    # by default, do not forward anything
    proxy_redirect off;
    proxy_buffering off;
    #-----------------------------------------------------------------------

    location / {
        proxy_pass http://test-paas;
    }

    # Chat and IM related features support
    location /longpolling {
        proxy_pass http://test-paas_longpolling;
    }
}

Install the Odoo-Infrastructure

Next step is to download and install the Odoo-Infrastructure application.


Configure Server

Enter your Odoo database.

Click Odoo Infrastructure on the menu.

You will see the entire Odoo infrastructure and its settings in the menu on the left.

The first step is to configure a server. We need to create an object of Odoo server and set up connection with physical Odoo instance. Let's do the necessary configuration:

  1. Click Odoo Infrastructure -> Servers. The page of Odoo Instances opens.
  2. To create a new server object, click Create. Fill in the form that appears.
  3. Enter the instance name in the upper field (this is more a descriptive name for the user, not a technical name).
  4. In the Host and Port fields, specify the parameters for connection to Odoo.
  5. Enter the Instance token. It will be written in the Odoo configuration file as a value of "yodoo_token". The filled form looks similar to this:
  6. Now, let's open the Templates & Defaults tab to set up Database Name and Database URL templates. These templates are used to generate names and URLs for newly created databases.
  7. The following database templates are python format string. You can use the following variables in strings formatting:
    - db - record of database
    - server - record of server
    You can access the fields of this variables with the help of point notation (for example "db.name").
    Specify the Database Name and Database URL templates as it is shown in the example below.
  8. Click Save to save the instance.
  9. Next, click the Test connection button to test a server connection. Until connection is established, the server is in the Draft state.
  10. If the test is passed, the server state will change to Active.

Once Odoo instance is created, two templates will be automatically generated for the instance. These templates are used to create remote databases. Click Templates on the instance form, to view this templates.

Configure Odoo Frontend

The second step is to configure Odoo Frontend.

  1. Click Odoo Infrastructure -> Odoo Frontends on the left menu.
  2. Click Create to create a new frontend. Fill in the opened form.
  3. Enter the frontend name.
  4. Enter the IP Address and Public IP Address in appropriate fields. The filled form looks similar to this:
  5. We can set up upstreams by clicking the Upstreams tab. Upstreams represents connections between the Odoo Servers and the Frontend. On the tab, click Add an item. A form appears.
  6. On the form, enter the upstream name, select the server from the list and click Save & Close.

The First Database

Now it is time to create some databases.

Database Name and URL

  1. Select Databases from the menu. On the page that opens, click Create.
  2. Fill in the form that opens. Enter the database name in the field at top.
  3. Select the Odoo instance from the drop-down list.
  4. The DB Name and URL fields will automatically fill in, according to the created instance templates.
  5. Next to the Stage field, you can select one of the database stages.
  6. On the Login Params tab, specify the Database user name and Database user password for logging in to the database.

Configure Database Backups

On the Backups tab, you can select the backup policy for this database. By default, two backup policies are available - Default backup policy (auto backups) and Manual only. You can create your custom policies and configure policy rules from the menu Odoo Infrastructure Settings -> Backup Policies.

Create Remote Database

  1. Save database configuration by clicking Save. Now your database is on the Draft state.

  2. Click Test on the left at the top. Database status will change to No remote db. A new button Create DB appears next to the Test button.

  3. To create a remote database, click Create DB.
  4. In the opened window, select the database template and click Create.
  5. After some time, a remote database will be created. The database state will change to Active.
    Additional actions will be available for the database on the control panel above.
  6. Click Sync to synchronize data from the remote database. On the Staticstics tab, you can view database statistics: installed apps and modules, users, etc.. You can also view database information and do necessary actions using the buttons in the upper-right corner of the form.

Connect Database to Frontend

  1. Click the Frontend tab and set up frontend configuration.
  2. Select the configured upstream next to the Upstream field.
  3. Next to the RPC allow field, specify the IP addresses that will be allowed (separated by commas or type "all").
  4. Next to the RPC deny enter the list of denied IP addresses (separated by commas or type "all").
  5. After filling in the form, click Sync frontend.
  6. The filled form looks like this:

Connect HTTPS

  1. To complete the database configuration, open the Frontend tab on the database form.
  2. If you did some data changes, click Sync frontend to update frontend.
  3. Click Get HTTPS State, you will see No HTTPS state below.
  4. Click Request HTTPS. The state will change to Requested.
  5. Try to Get HTTPS State again. In case of success, the state will change to Success. Now your Database configuration is complete.

Configure Database as Administrator

To log into your database as administrator, click Admin Access on the control panel.

You will enter your database.

Note. This action may be blocked by your browser and require additional permission.

As an administrator, install all the necessary applications, modules and configure settings for the future database template.

After configuration, click Sync on the database control panel again, you will see new installed apps and modules.

Create Database Template

Based on the previously configured database, we create a database template by duplicating it.

Duplicating the database is the fastest and the easiest way to create database templates.

  1. Click Odoo Infrastructure -> Database Tamplates. Then, click Create to create a new template.


    A form appears.
  2. Enter the template name in the upper field.
  3. Select the server.
  4. Select the Duplicate database type.
  5. Select the database to duplicate for creating a template.
  6. Click Save. Completed form looks similar to this:

Publish Template on Website

  1. Now publish the template on the website. Click the website button on the top right of the form.
  2. On the page that opens, click Unpublished to change its state to Published.
  3. Now our template is created and published on website.

Set Up Database Users

  1. Click Settings on the menu, then click General Settings.
  2. Scroll down to the Users menu group, select desired sign up options and click Default Access Rights.
  3. On the form, click Edit. Specify the name and email address. Select the Odoo Infrastructure Portal User check box. Save the form.

Create Database as a User

  1. User logs into the portal. Created templates can be seen on the Template Marketplace.

  2. Select the template.

  3. To create database, user will need to register on the portal.

  4. Fill in the form for registering.

  5. Click Create database.

  6. On the form for creating a database, user can select our template. URL of the database name will be set according to the database name template that we created earlier.

  7. After clicking Create database, the database will be created. It will be available by the appropriate URL.