Database management

# Database management

These guides provide instructions on how to install, maintain and upgrade Odoo databases.

## Installation

Depending on the intended use case, there are multiple ways to install Odoo - or not install it at
all.
- Online is the easiest way to use Odoo in production or to try it.
Online is the easiest way to use Odoo in production or to try it.
- Packaged installers are suitable for testing Odoo and
developing modules. They can be used for long-term production with additional deployment and
maintenance work.
Packaged installers are suitable for testing Odoo and
developing modules. They can be used for long-term production with additional deployment and
maintenance work.
- Source install provides greater flexibility, as it
allows, for example, running multiple Odoo versions on the same system. It is adequate to develop
modules and can be used as a base for production deployment.
Source install provides greater flexibility, as it
allows, for example, running multiple Odoo versions on the same system. It is adequate to develop
modules and can be used as a base for production deployment.
- A Docker base image is available for development or
deployment.
A Docker base image is available for development or
deployment.

## Editions

There are two different editions.
Odoo Community is the free and open-source version of the software, licensed under the GNU
LGPLv3 . It is the core upon which Odoo
Enterprise is built.
Odoo Enterprise is the shared source version of the software, giving access to more
functionalities, including functional support, upgrades, and hosting. Pricing starts from one app free.
Switch from Community to Enterprise at
any time (except for the source install).


Hosting

# Hosting

## Change hosting solution

The instructions to change the hosting type of a database depend on the current solution used and to
which solution the database should be moved.

## Transferring an on-premise database

### To Odoo Online

- Odoo Online is not compatible with non-standard apps .
Odoo Online is not compatible with non-standard apps .
- The databaseâs current version must be supported .
The databaseâs current version must be supported .
- Create a duplicate of the database .
Create a duplicate of the database .
- In this duplicate, uninstall all non-standard apps .
In this duplicate, uninstall all non-standard apps .
- Use the database manager to grab a dump with filestore .
Use the database manager to grab a dump with filestore .
- Create a support ticket including the following: your subscription number , the URL you want to use for the database (e.g., company.odoo.com ), and the dump as an attachment or as a link to the file (required for 60 MB+ files).
Create a support ticket including the following:
- your subscription number ,
your subscription number ,
- the URL you want to use for the database (e.g., company.odoo.com ), and
the URL you want to use for the database (e.g., company.odoo.com ), and
`company.odoo.com`
- the dump as an attachment or as a link to the file (required for 60 MB+ files).
the dump as an attachment or as a link to the file (required for 60 MB+ files).
- Odoo then makes sure the database is compatible before putting it online. In case of technical
issues during the process, Odoo might contact you.
Odoo then makes sure the database is compatible before putting it online. In case of technical
issues during the process, Odoo might contact you.
If you have time constraints, create a support ticket as soon
as possible to schedule the transfer.

### To Odoo.sh

Follow the instructions found in the Import a database section of the
Odoo.sh Create a project documentation.

## Transferring an Odoo Online database

Odoo Onlineâs intermediary versions are not supported by
Odoo.sh or on-premise. Therefore, if the database to transfer is running an intermediary version,
it must be upgraded first to the next major version , waiting
for its release if necessary.
Transferring an online database running on Odoo 16.3 would require first upgrading it to Odoo
17.0.
Click the ( gear ) button next to the database name on the Odoo
Online database manager to display its version number.
If there is an active Odoo subscription linked to the database being migrated, reach out to
the Customer Service Manager or contact Odoo support to
complete the subscription transfer.

### To on-premise

- Download a database backup by signing in to the Odoo Online database manager , clicking the ( gear ) button
next to the database name, then selecting Download . If the
download fails due to the file being too large, contact Odoo support .
Download a database backup by signing in to the Odoo Online database manager , clicking the ( gear ) button
next to the database name, then selecting Download . If the
download fails due to the file being too large, contact Odoo support .
- Restore the database from the database manager on your local server using the backup.
Restore the database from the database manager on your local server using the backup.

### To Odoo.sh

- Download a database backup by signing in to the Odoo Online database manager , clicking the ( gear ) button
next to the database name, then selecting Download . If the
download fails due to the file being too large, contact Odoo support .
Download a database backup by signing in to the Odoo Online database manager , clicking the ( gear ) button
next to the database name, then selecting Download . If the
download fails due to the file being too large, contact Odoo support .
- Follow the instructions found in the Import a database section of
the Odoo.sh Create a project documentation.
Follow the instructions found in the Import a database section of
the Odoo.sh Create a project documentation.

## Transferring an Odoo.sh database

### To Odoo Online

Odoo Online is not compatible with non-standard apps .
- Uninstall all non-standard apps in a staging build before doing it in the production build.
Uninstall all non-standard apps in a staging build before doing it in the production build.
- Create a support ticket including the following: your subscription number , the URL you want to use for the database (e.g., company.odoo.com ), which branch should be migrated, in which region you want the database to be hosted (Americas, Europe, or Asia), which user(s) will be the administrator(s) , and when (and in which timezone) you want the database to be up and running.
Create a support ticket including the following:
- your subscription number ,
your subscription number ,
- the URL you want to use for the database (e.g., company.odoo.com ),
the URL you want to use for the database (e.g., company.odoo.com ),
`company.odoo.com`
- which branch should be migrated,
which branch should be migrated,
- in which region you want the database to be hosted (Americas, Europe, or Asia),
in which region you want the database to be hosted (Americas, Europe, or Asia),
- which user(s) will be the administrator(s) , and
which user(s) will be the administrator(s) , and
- when (and in which timezone) you want the database to be up and running.
when (and in which timezone) you want the database to be up and running.
- Odoo then makes sure the database is compatible before putting it online. In case of technical
issues during the process, Odoo might contact you.
Odoo then makes sure the database is compatible before putting it online. In case of technical
issues during the process, Odoo might contact you.
- If you have time constraints, create a support ticket as
soon as possible to schedule the transfer.
If you have time constraints, create a support ticket as
soon as possible to schedule the transfer.
- Select the region closest to most of your users to reduce latency.
Select the region closest to most of your users to reduce latency.
- Future administrator(s) must have an Odoo.com account.
Future administrator(s) must have an Odoo.com account.
- The date and time you want the database to be up and running are helpful to organize the
switch from the Odoo.sh server to the Odoo Online servers.
The date and time you want the database to be up and running are helpful to organize the
switch from the Odoo.sh server to the Odoo Online servers.
- Databases are not reachable during their migration.
Databases are not reachable during their migration.

### To on-premise

- Download a backup of your Odoo.sh production database .
Download a backup of your Odoo.sh production database .
- Restore the database from the database manager on your local server using the backup.
Restore the database from the database manager on your local server using the backup.

Change hosting solution
Transferring an on-premise database
To Odoo Online
To Odoo.sh
Transferring an Odoo Online database
To on-premise
To Odoo.sh
Transferring an Odoo.sh database
To Odoo Online
To on-premise


Odoo mobile apps

# Odoo mobile apps

Two kind of Odoo mobile app exist: the progressive web app (PWA) and store apps. Using the PWA is
recommended.

## Progressive web app (PWA)

PWAs are web-based applications designed to function across different devices and platforms,
leveraging web browsers to deliver user experiences similar to native apps.
The Odoo PWA features include:
- Quick access by adding the PWA to a deviceâs home screen
Quick access by adding the PWA to a deviceâs home screen
- Seamless and borderless navigation experience
Seamless and borderless navigation experience
- Push notifications
- SSO authentication
To install the Odoo PWA, launch a browser supporting PWAs, and sign in to an Odoo database. The
instructions to install a PWA depend on the platform and browser used.
Chrome : open Chromeâs menu ( â® ), select Install app , and tap Install .
Firefox : open Firefoxâs menu ( â® ), select Install , and either touch
and hold the Odoo icon or tap Add automatically .
The PWA can also be installed with Samsung Internet , Edge , and Opera .
Safari : open the Share menu by tapping the square with an arrow pointing upwards icon,
select Add to Home Screen , edit the PWA details if desired, and tap Add .
On iOS 16.4 and above, the PWA can also be installed with Chrome , Firefox , and Edge .
Chrome and Edge : click the installation icon at the right of the address bar and click Install .
- Google Chrome Help: Use progressive web apps
Google Chrome Help: Use progressive web apps
- MDN Web Docs: Installing and uninstalling web apps
MDN Web Docs: Installing and uninstalling web apps
- Microsoft Support: Install, manage, or uninstall apps in Microsoft Edge
Microsoft Support: Install, manage, or uninstall apps in Microsoft Edge

## Store apps

The Odoo mobile apps are available for download on the Google Play Store and Apple App Store .
While the store apps support multi-accounts, they are not compatible with SSO authentication.


Neutralized database

# Neutralized database

A neutralized database is a non-production database on which several parameters are deactivated.
This enables one to carry out tests without the risk of launching specific automated processes that
could impact production data (e.g., sending emails to customers). Live access is removed and
turned into a testing environment.
Any testing database created is a neutralized database:
- testing backup databases
testing backup databases
- duplicate databases
- for Odoo.sh: staging and development databases
for Odoo.sh: staging and development databases
A database can also be neutralized when upgrading, as it is vital to do some tests before
switching to a new version.

## Deactivated features

Here is a non-exhaustive list of the deactivated features:
- all planned actions (e.g., automatic invoicing of subscriptions, mass mailing, etc.)
all planned actions (e.g., automatic invoicing of subscriptions, mass mailing, etc.)
- outgoing emails
- bank synchronization
- payment providers
- delivery methods
- IAP tokens
- website visibility (prevent search engines from indexing your site)
website visibility (prevent search engines from indexing your site)
A red banner at the top of the screen is displayed on the neutralized database so that it can
be seen immediately.


Odoo.com account

# Odoo.com account

Open the Connection & Security page on your Odoo.com account
portal to:
- Change your Password . Note When you create a database, a user linked to your Odoo.com account is generated on the
database. Changing your Odoo.com accountâs password will also modify the password used to
sign in with that user to the database. You can set a database-specific password for that user by going to the databaseâs
settings . However, you will still be able to sign in with your
Odoo.com accountâs password.
Change your Password .
- When you create a database, a user linked to your Odoo.com account is generated on the
database. Changing your Odoo.com accountâs password will also modify the password used to
sign in with that user to the database.
When you create a database, a user linked to your Odoo.com account is generated on the
database. Changing your Odoo.com accountâs password will also modify the password used to
sign in with that user to the database.
- You can set a database-specific password for that user by going to the databaseâs
settings . However, you will still be able to sign in with your
Odoo.com accountâs password.
You can set a database-specific password for that user by going to the databaseâs
settings . However, you will still be able to sign in with your
Odoo.com accountâs password.
- Enable Two-factor authentication using an authenticator app. See also Refer to the Two-factor authentication documentation for more information. The process to enable it for a database user and for your Odoo.com
account is similar.
Enable Two-factor authentication using an authenticator app.
Refer to the Two-factor authentication documentation for more information. The process to enable it for a database user and for your Odoo.com
account is similar.
- Log out from all devices signed in to your Odoo.com account, except for the current
session. Tip To log out from the current session, click the ( user )
icon in the top right and select Logout .
Log out from all devices signed in to your Odoo.com account, except for the current
session.
To log out from the current session, click the ( user )
icon in the top right and select Logout .
- Enable developer mode to add a developer API key .
Enable developer mode to add a developer API key .
- Delete your account. Danger Deleting your Odoo.com account is irreversible . Once deleted, your account cannot be
retrieved .
Deleting your Odoo.com account is irreversible . Once deleted, your account cannot be
retrieved .
Open the Account Information page to edit your account details,
including your email address .
- When you create a database, a user linked to your Odoo.com account is generated on the
database. Changing your Odoo.com accountâs email address does not modify the email address used
to sign in with that user.
When you create a database, a user linked to your Odoo.com account is generated on the
database. Changing your Odoo.com accountâs email address does not modify the email address used
to sign in with that user.
- You can set a database-specific email address for that user by clicking your avatar in the
top-right corner of the database and selecting My Preferences . You will still need
to sign in to the database using the email address used at the time of the database creation.
You can set a database-specific email address for that user by clicking your avatar in the
top-right corner of the database and selecting My Preferences . You will still need
to sign in to the database using the email address used at the time of the database creation.
- To change the email address used to sign in to a database, contact Odoo Support .
To change the email address used to sign in to a database, contact Odoo Support .
In addition to the database you create, all databases you are invited to join with your Odoo.com accountâs email address will be displayed under the database manager .


Odoo Online

# Odoo Online

Odoo Online offers private databases hosted and managed by Odoo.
Odoo Online databases can be accessed using any web browser and do not require a local installation.
They can be used for long-term production or to thoroughly test Odoo, including customizations that
do not require custom code.
To quickly try out Odoo, shared demo databases are available for
testing. No registration is required; however, each database is only available for a few hours.
Odoo Online is incompatible with custom modules or modules from the Odoo Apps Store .

## Database manager

To manage an Odoo Online database, open to the database manager and sign in as the database administrator.

### Domain names

Configure a custom domain name by selecting a database and clicking Domain Names .
Register a domain name for free .

### Tags

Add tags to identify and sort databases by selecting a database and clicking Tags . In the dialog box, enter a tag, click the ( plus ) button, and click Save .
Search for tags in the search bar at the top right.

### Hide

Permanently hide the database from the database manager by selecting it and clicking Hide . In the dialog box, click Yes, I donât need it
anymore .
It is possible to access a hidden database through its URL.

### Manage

Access all other database management options by selecting it and clicking Manage .

#### Switch plans

Switch pricing plans by clicking Switch under the
desired plan.

#### Upgrade

Launch a database upgrade by clicking Upgrade .
This option is only displayed when an upgrade is available.

#### Rename

Rename and change the URL of a database by clicking Rename . In the dialog box, enter a New name and click Rename .

#### Duplicate

Create a copy of the database by clicking Duplicate . In the dialog box, enter a New name and click Duplicate .
- By default, the For testing purposes option is enabled. It disables all external
actions (emails, payments, delivery orders, etc.) on the duplicated database.
By default, the For testing purposes option is enabled. It disables all external
actions (emails, payments, delivery orders, etc.) on the duplicated database.
- Duplicates expire after 15 days.
Duplicates expire after 15 days.
- A maximum of five duplicates can be created per database. Under extraordinary circumstances,
contact Odoo Support to extend the limit.
A maximum of five duplicates can be created per database. Under extraordinary circumstances,
contact Odoo Support to extend the limit.

#### Download a backup

Download a ZIP file containing a database backup by clicking Download Backup .
- Databases are backed up daily as per the Odoo Cloud Hosting SLA .
Databases are backed up daily as per the Odoo Cloud Hosting SLA .
- If the Download Backup option is disabled, it means the database is too large to be
downloaded using the database manager. Contact Odoo Support to
request an alternative download solution.
If the Download Backup option is disabled, it means the database is too large to be
downloaded using the database manager. Contact Odoo Support to
request an alternative download solution.

#### View admin activity logs

View the logs of all actions taken by Odoo employees or the database administrator on the database
by clicking View Admin Activity Logs .
Actions taken by Odoo employees are typically the result of requests submitted to Odoo support,
done within the context of a quick start project, or necessary to maintain the database.

#### Transfer ownership

Create a support ticket to request a database ownership transfer by clicking Transfer
Ownership .

#### Delete

Delete the database and close its related subscription by clicking Delete . In the dialog
box, click Delete .
All the databaseâs data will be deleted instaneously for all users and cannot be restored . It
is recommended to download a backup before deleting a database.
After deletion, the databaseâs name becomes available to anyone.

## Web services

To retrieve a list of all databases displayed under the database manager programmatically, call the list method of the odoo.database model via an web service call.
`list`
`odoo.database`
To retrieve this list with the xmlrpc.client library:
`xmlrpc.client`
The equivalent example with JSON-RPC:

Database manager
Domain names
Tags
Hide
Manage
Web services


Odoo.sh

# Odoo.sh

Odoo.sh is the official cloud platform for hosting and managing Odoo applications. It offers a
range of features such as web shell, module dependencies, continuous integration, and SSH access.


Containers

# Containers

## Overview

Each build is isolated within its own container (Linux namespaced container).
The base is an Ubuntu system, where all of Odooâs required dependencies,
as well as common useful packages, are installed.
If your project requires additional Python dependencies, or more recent releases,
you can define a requirements.txt file in the root of your branches listing them.
The platform will take care to install these dependencies in your containers. The pip requirements specifiers documentation can help you write a requirements.txt file.
To have a concrete example,
check out the requirements.txt file of Odoo .
`requirements.txt`
`requirements.txt`
The requirements.txt files of submodules are taken into account as well. The platform
looks for requirements.txt files in each folder containing Odoo modules: Not in the module folder itself,
but in their parent folder.
`requirements.txt`
`requirements.txt`

## Directory structure

As the containers are Ubuntu based, their directory structure follows the linux Filesystem Hierarchy Standard. Ubuntuâs filesystem tree overview explains the main directories.
Here are the Odoo.sh pertinent directories:
Both Python 2.7 and 3.5 are installed in the containers. However:
- If your project is configured to use Odoo 10.0, the Odoo server runs with Python 2.7.
If your project is configured to use Odoo 10.0, the Odoo server runs with Python 2.7.
- If your project is configured to use Odoo 11.0 or above, the Odoo server runs with Python 3.5.
If your project is configured to use Odoo 11.0 or above, the Odoo server runs with Python 3.5.

## Database shell

While accessing a container with the shell, you can access the database using psql .
Be careful ! Use transactions ( BEGINâ¦COMMIT/ROLLBACK )
for every sql statements leading to changes
( UPDATE , DELETE , ALTER , â¦), especially for your production database.
The transaction mechanism is your safety net in case of mistake.
You simply have to rollback your changes to revert your database to its previous state.
For example, it may happen that you forget to set your WHERE condition.
In such a case, you can rollback to revert the unwanted changes that you just mistakenly did, and rewrite the statement:
However, do not forget to either commit or rollback your transaction after having done it.
Open transactions may lock records in your tables
and your running database may wait for them to be released. It can cause a server to hang indefinitely.
In addition, when possible, use your staging databases to test your statements first. It gives you an extra safety net.

## Run an Odoo server

You can start an Odoo server instance from a container shell. You wonât be able to access it from the outside world
with a browser, but you can for instance:
- use the Odoo shell,
- install a module,
- update a module,
- run the tests for a module,
run the tests for a module,
In the above commands, the argument:
- --without-demo=all prevents demo data to be loaded for all modules
--without-demo=all prevents demo data to be loaded for all modules
`--without-demo=all`
- --stop-after-init will immediately shutdown the server instance after it completed the operations you asked.
--stop-after-init will immediately shutdown the server instance after it completed the operations you asked.
`--stop-after-init`
More options are available and detailed in the CLI documentation .
You can find in the logs ( ~/logs/odoo.log ) the addons path used by Odoo.sh to run your server.
Look for â odoo: addons paths â:
Be careful , especially with your production database.
Operations that you perform running this Odoo server instance are not isolated:
Changes will be effective in the database. Always, make your tests in your staging databases.

## Debugging in Odoo.sh

Debugging an Odoo.sh build is not really different than another Python app. This article only explains the specificities and limitations of the Odoo.sh platform, and assumes that you already know how to use a debugger.
If you donât know how to debug a Python application yet, there are multiple introductory courses that can be easily found on the Internet.
You can use pdb , pudb or ipdb to debug your code on Odoo.sh.
As the server is run outside a shell, you cannot launch the debugger directly from your Odoo instance backend as the debugger needs a shell to operate.
`pdb`
`pudb`
`ipdb`
- pdb is installed by default in every container.
pdb is installed by default in every container.
- If you want to use pudb or ipdb you have to install it before. To do so, you have two options: temporary (only in the current build): $  pip install pudb --user or $  pip install ipdb --user permanent: add pudb or ipdb to your project requirements.txt file.
If you want to use pudb or ipdb you have to install it before.
To do so, you have two options:
- temporary (only in the current build): $  pip install pudb --user or $  pip install ipdb --user
temporary (only in the current build):
- permanent: add pudb or ipdb to your project requirements.txt file.
permanent: add pudb or ipdb to your project requirements.txt file.
`pudb`
`ipdb`
`requirements.txt`
Then edit the code where you want to trigger the debugger and add this:
The condition sys.__stdin__.isatty() is a hack that detects if you run Odoo from a shell.
`sys.__stdin__.isatty()`
Save the file and then run the Odoo Shell:
Finally, via the Odoo Shell, you can trigger the piece of code/function/method
you want to debug.

Overview
Directory structure
Database shell
Run an Odoo server
Debugging in Odoo.sh


Frequent Technical Questions

# Frequent Technical Questions

## âScheduled actions do not run at the exact time they were expectedâ

On the Odoo.sh platform, we cannot guarantee an exact running time for scheduled actions.
This is due to the fact that there might be multiple customers on the same server, and we must guarantee a fair share of the server for every customer. Scheduled actions are therefore implemented slightly differently than on a regular Odoo server, and are run on a best effort policy.
Do not expect any scheduled action to be run more often than every 5 min.

## Are there âbest practicesâ regarding scheduled actions?

Odoo.sh always limits the execution time of scheduled actions (*aka* crons). Therefore, you must keep this fact in mind when developing your own crons.
- Your scheduled actions should work on small batches of records.
Your scheduled actions should work on small batches of records.
- Your scheduled actions should commit their work after processing each batch;
this way, if they get interrupted by the time-limit, there is no need to start over.
Your scheduled actions should commit their work after processing each batch;
this way, if they get interrupted by the time-limit, there is no need to start over.
- Your scheduled actions should be idempotent : they must not
cause side-effects if they are started more often than expected.
Your scheduled actions should be idempotent : they must not
cause side-effects if they are started more often than expected.

## How can I automate tasks when an IP address change occurs?

Odoo.sh notifies project administrators of IP address changes. Additionally, when the IP address of a production instance changes, an HTTP GET request is made
to the path /_odoo.sh/ip-change with the new IP address included as a query string parameter
( new ), along with the previous IP address as an additional parameter ( old ).
`GET`
`/_odoo.sh/ip-change`
`new`
`old`
This mechanism allows custom actions to be applied in response to the IP address change
(e.g., sending an email, contacting a firewall API, configuring database objects, etc.)
For security reasons, the /_odoo.sh/ip-change route is accessible only internally by the platform
itself and returns a 403 response if accessed through any other means.
`/_odoo.sh/ip-change`
`403`
Here is a pseudo-implementation example:


Submodules

# Submodules

## Overview

A Git submodule allows you to integrate other Git projects
into your code, without the need to copy-paste all their code.
Indeed, your custom modules can depend on modules from other repositories.
Regarding Odoo, this feature allows you to add modules from other Git repositories into the branches of your repository.
Adding these dependencies in your branch through submodules makes the deployment of your code and servers easier,
as you can clone the repositories added as submodules at the same time you clone your own repository.
Besides, you can choose the branch of the repository added as submodule
and you have the control of the revision you want.
Itâs up to you to decide whether you want to pin the submodule to a specific revision and when you want to update
to a newer revision.
In Odoo.sh, the submodules give you the possibility to use and depend on modules available in other repositories.
The platform will detect that you added modules through submodules in your branches
and add them to your addons path automatically so you can install them in your databases.
If you add private repositories as submodules in your branches,
you need to configure a deploy key in your Odoo.sh project settings and in your repository settings.
Otherwise Odoo.sh wonât be allowed to download them.
The procedure is detailed in the chapter Settings > Submodules .

## Adding a submodule

### With Odoo.sh (simple)

For now it is not possible to add private repositories with this method. You can nevertheless
do so with Git .
On Odoo.sh, in the branches view of your project, choose the branch in which you want to add a submodule.
In the upper right corner, click on the Submodule button, and then on Run .
A dialog with a form is shown. Fill the inputs as follows:
- Repository URL: The SSH URL of the repository.
Repository URL: The SSH URL of the repository.
- Branch: The branch you want to use.
Branch: The branch you want to use.
- Path: The folder in which you want to add this submodule in your branch.
Path: The folder in which you want to add this submodule in your branch.
On Github, you can get the repository URL with the Clone or download button of the repository. Make sure to use SSH .

### With Git (advanced)

In a terminal, in the folder where your Git repository is cloned,
checkout the branch in which you want to add a submodule:
Then, add the submodule using the command below:
- <git@yourprovider.com>:<username/repository.git> by the SSH URL of the repository you want to add as submodule,
<git@yourprovider.com>:<username/repository.git> by the SSH URL of the repository you want to add as submodule,
- <branch> by the branch you want to use in the above repository,
<branch> by the branch you want to use in the above repository,
- <path> by the folder in which you want to add this submodule.
<path> by the folder in which you want to add this submodule.
Commit and push your changes:
- <remote> by the repository on which you want to push your changes. For a standard Git setup, this is origin .
<remote> by the repository on which you want to push your changes. For a standard Git setup, this is origin .
- <branch> by the branch on which you want to push your changes.
Most likely the branch you used git checkout on in the first step.
<branch> by the branch on which you want to push your changes.
Most likely the branch you used git checkout on in the first step.
`gitcheckout`
You can read the git-scm.com documentation for more details about the Git submodules.
For instance, if you would like to update your submodules to have their latest revision,
you can follow the chapter Pulling in Upstream changes .

## Ignore modules

If youâre adding a repository that contains a lot of modules, you may want to ignore some of them in case there are any
that are installed automatically. To do so, you can prefix your submodule folder with a . . The platform will
ignore this folder and you can hand pick your modules by creating symlinks to them from another folder.
`.`

Overview
Adding a submodule
With Odoo.sh (simple)
With Git (advanced)
Ignore modules


Your first module

# Your first module

## Overview

This chapter helps you to create your first Odoo module and deploy it in your Odoo.sh project.
This tutorial requires you created a project on Odoo.sh, and
you know your Github repositoryâs URL.
Basic use of Git and Github is explained.
The below assumptions are made:
- ~/src is the directory where are located the Git repositories related to your Odoo projects,
~/src is the directory where are located the Git repositories related to your Odoo projects,
- odoo is the Github user,
odoo is the Github user,
- odoo-addons is the Github repository,
odoo-addons is the Github repository,
- feature-1 is the name of a development branch,
feature-1 is the name of a development branch,
- master is the name of the production branch,
master is the name of the production branch,
- my_module is the name of the module.
my_module is the name of the module.
Replace these by the values of your choice.

## Create the development branch

### From Odoo.sh

In the branches view:
- hit the + button next to the development stage,
hit the + button next to the development stage,
`+`
- choose the branch master in the Fork selection,
choose the branch master in the Fork selection,
- type feature-1 in the To input.
type feature-1 in the To input.
Once the build created, you can access the editor and browse to the folder ~/src/user to access
to the code of your development branch.

### From your computer

Clone your Github repository on your computer:

## Create the module structure

### Scaffolding the module

While not necessary, scaffolding avoids the tedium of setting the basic Odoo module structure.
You can scaffold a new module using the executable odoo-bin .
From the Odoo.sh editor, in a terminal:
Or, from your computer, if you have an installation of Odoo:
If you do not want to bother installing Odoo on your computer,
you can also download this module structure template in
which you replace every occurrences of my_module to the name of your choice.
`downloadthismodulestructuretemplate`
The below structure will be generated:
Do not use special characters other than the underscore ( _ ) for your module name, not even an
hyphen ( - ). This name is used for the Python classes of your module, and having classes name
with special characters other than the underscore is not valid in Python.
Uncomment the content of the files:
- models/models.py ,
an example of model with its fields,
models/models.py ,
an example of model with its fields,
- views/views.xml ,
a tree and a form view, with the menus opening them,
views/views.xml ,
a tree and a form view, with the menus opening them,
- demo/demo.xml ,
demo records for the above example model,
demo/demo.xml ,
demo records for the above example model,
- controllers/controllers.py ,
an example of controller implementing some routes,
controllers/controllers.py ,
an example of controller implementing some routes,
- views/templates.xml ,
two example qweb views used by the above controller routes,
views/templates.xml ,
two example qweb views used by the above controller routes,
- __manifest__.py ,
the manifest of your module, including for instance its title, description and data files to load.
You just need to uncomment the access control list data file: # 'security/ir.model.access.csv',
__manifest__.py ,
the manifest of your module, including for instance its title, description and data files to load.
You just need to uncomment the access control list data file:

### Manually

If you want to create your module structure manually,
you can follow the Server framework 101 tutorial to understand
the structure of a module and the content of each file.

## Push the development branch

Stage the changes to be committed
Push your changes to your remote repository
From an Odoo.sh editor terminal:
The above command is explained in the section Commit and push changes of the Online editor page .
It includes the explanation regarding the fact you will be prompted to type your username and
password, and what to do if you use the two-factor authentication.
Or, from your computer terminal:
You need to specify -u origin feature-1 for the first push only.
From that point, to push your future changes from your computer, you can simply use

## Test your module

Your branch should appear in your development branches in your project.
In the branches view of your project,
you can click on your branch name in the left navigation panel to access its history.
You can see here the changes you just pushed, including the comment you set.
Once the database ready, you can access it by clicking the Connect button.
If your Odoo.sh project is configured to install your module automatically,
you will directly see it amongst the database apps. Otherwise, it will be available in the apps to
install.
You can then play around with your module, create new records and test your features and buttons.

## Test with the production data

You need to have a production database for this step. You can create it if you do not have it yet.
Once you tested your module in a development build with the demo data and believe it is ready,
you can test it with the production data using a staging branch.
- Make your development branch a staging branch, by drag and dropping it onto the staging section
title.
Make your development branch a staging branch, by drag and dropping it onto the staging section
title.
- Merge it in an existing staging branch, by drag and dropping it onto the given staging branch.
Merge it in an existing staging branch, by drag and dropping it onto the given staging branch.
You can also use the git merge command to merge your branches.
`gitmerge`
This will create a new staging build, which will duplicate the production database and make it run
using a server updated with your latest changes of your branch.
Once the database ready, you can access it using the Connect button.

### Install your module

Your module will not be installed automatically, you have to install it from the apps menu. Indeed,
the purpose of the staging build is to test the behavior of your changes as it would be on your
production, and on your production you would not like your module to be installed automatically, but
on demand.
Your module may not appear directly in your apps to install either, you need to update your apps
list first:
- Activate the developer mode
Activate the developer mode
- in the apps menu, click the Update Apps List button,
in the apps menu, click the Update Apps List button,
- in the dialog that appears, click the Update button.
in the dialog that appears, click the Update button.
Your module will then appear in the list of available apps.

## Deploy in production

Once you tested your module in a staging branch with your production data,
and believe it is ready for production, you can merge your branch in the production branch.
Drag and drop your staging branch on the production branch.
You can also use the git merge command to merge your branches.
`gitmerge`
This will merge the latest changes of your staging branch in the production branch,
and update your production server with these latest changes.
Once the database ready, you can access it using the Connect button.

### Install your module

Your module will not be installed automatically,
you have to install it manually as explained in the above section about installing your module in staging databases .

## Add a change

This section explains how to add a change in your module by adding a new field in a model and deploy
it.
- browse to your module folder ~/src/user/my_module ,
browse to your module folder ~/src/user/my_module ,
- then, open the file models/models.py .
then, open the file models/models.py .
- use the file browser of your choice to browse to your module folder ~/src/odoo-addons/my_module ,
use the file browser of your choice to browse to your module folder ~/src/odoo-addons/my_module ,
- then, open the file models/models.py using the editor of your choice,
such as Atom , Sublime Text , PyCharm , vim , â¦
then, open the file models/models.py using the editor of your choice,
such as Atom , Sublime Text , PyCharm , vim , â¦
Then, after the description field
Then, open the file views/views.xml .
These changes alter the database structure by adding a column in a table,
and modify a view stored in database.
In order to be applied in existing databases, such as your production database,
these changes requires the module to be updated.
If you would like the update to be performed automatically by the Odoo.sh platform when you push
your changes, increase your module version in its manifest.
Open the module manifest __manifest__.py .
The platform will detect the change of version and trigger the update of the module upon the new
revision deployment.
Browse to your Git folder.
Then, from an Odoo.sh terminal:
Or, from your computer terminal:
Then, stage your changes to be committed
From an Odoo.sh terminal:
Or, from your computer terminal:
The platform will then create a new build for the branch feature-1 .
Once you tested your changes, you can merge your changes in the production branch, for instance by
drag-and-dropping the branch on the production branch in the Odoo.sh interface. As you increased the
module version in the manifest, the platform will update the module automatically and your new field
will be directly available. Otherwise you can manually update the module within the apps list.

## Use an external Python library

If you would like to use an external Python library which is not installed by default,
you can define a requirements.txt file listing the external libraries your modules depends on.
- It is not possible to install or upgrade system packages on an Odoo.sh database (e.g., apt
packages). However, under specific conditions, packages can be considered for installation.
This also applies to Python modules requiring system packages for their compilation, and third-party Odoo modules .
It is not possible to install or upgrade system packages on an Odoo.sh database (e.g., apt
packages). However, under specific conditions, packages can be considered for installation.
This also applies to Python modules requiring system packages for their compilation, and third-party Odoo modules .
- PostgreSQL extensions are not supported on Odoo.sh.
PostgreSQL extensions are not supported on Odoo.sh.
- For more information, consult our FAQ .
For more information, consult our FAQ .
The platform will use this file to automatically install the Python libraries your project needs.
The feature is explained in this section by using the Unidecode library in your module.
Create a file requirements.txt in the root folder of your repository
From the Odoo.sh editor, create and open the file ~/src/user/requirements.txt.
Or, from your computer, create and open the file ~/src/odoo-addons/requirements.txt.
Then use the library in your module, for instance to remove accents from characters in the name
field of your model.
Open the file models/models.py .
Adding a Python dependency requires a module version increase for the platform to install it.
Edit the module manifest __manifest__.py
Stage and commit your changes:
Then, push your changes:
In an Odoo.sh terminal:
In your computer terminal:

Overview
Create the development branch
From Odoo.sh
From your computer
Create the module structure
Scaffolding the module
Manually
Push the development branch
Test your module
Test with the production data
Install your module
Deploy in production
Install your module
Add a change
Use an external Python library


Getting started

# Getting started

## Main components

When working with Odoo.sh, it is important to understand the main components involved. While they
are all interconnected, each one plays a distinct role in the development and deployment of Odoo
applications:
- GitHub repository : a version-controlled space where the Odoo applicationsâ source code is
stored. It tracks every change, supports collaboration, and can be either public or private.
GitHub repository : a version-controlled space where the Odoo applicationsâ source code is
stored. It tracks every change, supports collaboration, and can be either public or private.
- Odoo.sh project : a Platform as a Service (PaaS) that integrates with GitHub and enables
streamlined development, testing, and deployment of Odoo applications. It includes tools such as
automated backups, staging environments, and continuous integration pipelines.
Odoo.sh project : a Platform as a Service (PaaS) that integrates with GitHub and enables
streamlined development, testing, and deployment of Odoo applications. It includes tools such as
automated backups, staging environments, and continuous integration pipelines.
- Odoo database : a database stores all the operational data used and generated by Odoo
applications, such as business records, configurations, and user data.
Odoo database : a database stores all the operational data used and generated by Odoo
applications, such as business records, configurations, and user data.
Together, they form a cohesive pipeline from code development to a live business use.

## User types

Odoo.sh involves different types of users, each with a specific role in the project lifecycle:
- GitHub users: developers with access to the GitHub repository linked to the Odoo.sh project.
Access to the repository does not automatically make someone a collaborator on the Odoo.sh
project.
GitHub users: developers with access to the GitHub repository linked to the Odoo.sh project.
Access to the repository does not automatically make someone a collaborator on the Odoo.sh
project.
- Odoo.sh collaborators: individuals managing the Odoo.sh project. Each collaborator must be
linked to a GitHub user. However, collaborators are not the same as database users.
Odoo.sh collaborators: individuals managing the Odoo.sh project. Each collaborator must be
linked to a GitHub user. However, collaborators are not the same as database users.
- Database users: end-users of the deployed Odoo database. They interact with the live system but
are not involved in development or project management.
Database users: end-users of the deployed Odoo database. They interact with the live system but
are not involved in development or project management.


Branches

# Branches

The Branches view provides an overview of the different branches in your repository.

## Stages

Odoo.sh offers three different branch stages:
- Production
- Staging
- Development
You can change the stage of a branch by dragging and dropping it under the desired stage.
- Development branches can be moved under Staging . If you try to move a development
branch under Production , a warning message will be displayed explaining that you
can only have one production branch per project.
Development branches can be moved under Staging . If you try to move a development
branch under Production , a warning message will be displayed explaining that you
can only have one production branch per project.
- Staging branches can be moved under Development , but it is not possible to move
them under Production .
Staging branches can be moved under Development , but it is not possible to move
them under Production .
- The production branch can only be moved under Development . If you try to move it
under Staging , you can only perform a merge. Refer to the merging section for a detailed explanation of this
process.
The production branch can only be moved under Development . If you try to move it
under Staging , you can only perform a merge. Refer to the merging section for a detailed explanation of this
process.

### Production

The production branch contains the code used to run the production database. There can be only one
production branch.
When you push a new commit to this branch, the production server is updated with the revised code
and restarted.
If the changes require a module update, such as changing a form view, and you want the update to
be performed automatically, you can increase the moduleâs version number in its manifest file
( __manifest__.py ). The platform then performs the update, during which the instance will be
held temporarily unavailable for maintenance reasons.
`__manifest__.py`
This method is equivalent to upgrading the module using the Apps menu or the -u switch
on the command line .
`-u`
- If the changes prevent the server from restarting or if the module update fails, the server is
automatically reverted to the previous successful code revision, and the database is rolled
back to its previous state. Access to the failed updateâs log to troubleshoot it.
If the changes prevent the server from restarting or if the module update fails, the server is
automatically reverted to the previous successful code revision, and the database is rolled
back to its previous state. Access to the failed updateâs log to troubleshoot it.
- The demo data is not loaded, as it is not intended for use on a production database. The unit
tests are not performed, as it would increase
the unavailability time of the production database during the update.
The demo data is not loaded, as it is not intended for use on a production database. The unit
tests are not performed, as it would increase
the unavailability time of the production database during the update.
Odoo.sh automatically backs up the production database. It keeps seven daily, four weekly, and three
monthly backups. Each backup includes the database dump, the filestore (attachments and binary
fields), logs, and sessions.
When using trial projects , the production branch and all staging branches are automatically
set back to the development stage after 30 days .

### Staging

Staging branches are meant to test new features using production data without compromising the
actual production database with test records. They create neutralized duplicates of the production
database.
The neutralization disables:
- Scheduled actions Note To test them, trigger them manually or re-enable them. Be aware that the platform will trigger
them less often if no one is using the database in order to save resources.
To test them, trigger them manually or re-enable them. Be aware that the platform will trigger
them less often if no one is using the database in order to save resources.
- Outgoing emails Note They are instead intercepted using a mail catcher. An interface to view the emails sent by the database is provided in your Odoo.sh project.
That way, no emails are sent to your contacts.
They are instead intercepted using a mail catcher. An interface to view the emails sent by the database is provided in your Odoo.sh project.
That way, no emails are sent to your contacts.
- IAP services
- Payment providers and shipping connectors Note They are put into test mode.
Payment providers and shipping connectors
They are put into test mode.
If you configure or view changes in a staging database, make sure to record them (noting them step
by step, reproducing in production, etc.) or write them directly in the branchâs modules, using XML
data files to override the default configuration or views. Check the first module
documentation to view examples.
Unit tests are not performed. They rely on demo data, which is not loaded into the production and
staging databases. If Odoo starts supporting running the units without demo data, Odoo.sh will
then consider running the tests on staging databases.
Staging databases are not automatically backed up. Nevertheless, you can restore a backup of the
production database in a staging branch for testing purposes or to manually recover data that has
been accidentally deleted from the production database. It is possible to create manual backups of
staging databases.
Databases created for staging branches are automatically deleted after one month. To use the
branch again, you must rebuild it.

### Development

Development branches create new databases using demo data to run the unit tests. The installed
modules are those included in the branch. You can change this list of modules to install in the project settings .
When pushing a commit to a development branch, a new server is started, with a database created from
scratch, and the branch is updated. The demo data is loaded, and the unit tests are performed by
default to verify that the changes do not break any of the features being tested. You can disable
the tests or allow specific tests to be run with custom tags by going to the branchâs settings .
Similarly to staging branches, emails are not sent but are intercepted by a mail catcher, and
scheduled actions are not triggered as long as the database is not in use.
Development databases are not automatically backed up, and manual backups are not possible.
Databases created for development branches are intended to last approximately three days. After
that, they can be automatically garbage-collected to make room for new databases without prior
notice.

### Merging branches

You can merge your branches by dragging and dropping them into each other.
To test the changes of development branches with the production data, you can either:
- Merge the development branch into a staging branch by dragging and dropping it onto the desired
branch; or
Merge the development branch into a staging branch by dragging and dropping it onto the desired
branch; or
- Drag and drop the development branch under the Staging section to make it a staging
branch.
Drag and drop the development branch under the Staging section to make it a staging
branch.
When the changes are ready for production, drag and drop the staging branch into the production
branch to merge and deploy them.
- You can merge development branches into the production branch directly. However, changes will
not be validated against the production data through a staging branch, so there is a higher
risk of encountering issues in the production database.
You can merge development branches into the production branch directly. However, changes will
not be validated against the production data through a staging branch, so there is a higher
risk of encountering issues in the production database.
- You can merge development branches into each other, and staging branches into each other.
You can merge development branches into each other, and staging branches into each other.
- You can also use git merge directly on your workstation to merge your branches. Odoo.sh is
notified when new revisions are pushed to your branches.
You can also use git merge directly on your workstation to merge your branches. Odoo.sh is
notified when new revisions are pushed to your branches.
`gitmerge`
Merging a staging branch into the production branch only merges the source code. Any changes made to
the staging database are not passed to the production database. However, if you modify the code in
the repository, it will be passed to the production branch when merging.
If you test configuration changes in staging branches, and want them to be applied to the production
branch, you have to, either:
- Write the configuration changes in XML data files to overide the default configuration or views in
the branch, and then increase the version of the module in its manifest ( __manifest__.py )
to trigger the module update when merging the staging branch in the production branch. Note This method is recommended for better scalability of your developments, as you will use the Git
versioning features for all configuration changes, thereby ensuring traceability of your
changes.
Write the configuration changes in XML data files to overide the default configuration or views in
the branch, and then increase the version of the module in its manifest ( __manifest__.py )
to trigger the module update when merging the staging branch in the production branch.
`__manifest__.py`
This method is recommended for better scalability of your developments, as you will use the Git
versioning features for all configuration changes, thereby ensuring traceability of your
changes.
- Pass them manually from the staging database to the production one by copying and pasting them.
Pass them manually from the staging database to the production one by copying and pasting them.

## Tabs

### History

The History tab gives an overview of the branch history:
- The commit messages and their authors
The commit messages and their authors
- The various events linked to the platform, such as stage changes, database imports, and backup
restores
The various events linked to the platform, such as stage changes, database imports, and backup
restores
A status in the top right corner of each event indicates the current operation on the database
(e.g., installation, update, backup import) or its outcome (e.g., test feedback, successful backup
import). If an operation is successful, a Connect button appears, allowing you to access
the database.

### Mails

The Mails tab contains the mail catcher, which provides an overview of emails sent by
the database.
The mail catcher is available for development and staging branches. Emails from the production
database are actually sent and are not intercepted by the mail catcher.

### Shell

The Shell tab provides shell access to the container.
Clicking Shell opens a new browser tab where you can run basic Linux commands ( ls , top ). You can open a shell on the database by running psql .
`ls`
`top`
`psql`
You can open multiple shell tabs at once and arrange their layout by dragging and dropping them.
- Production instance shells are highlighted in red to emphasize the danger of manipulating
production instances directly, while staging/development instance shells are highlighted in
yellow.
Production instance shells are highlighted in red to emphasize the danger of manipulating
production instances directly, while staging/development instance shells are highlighted in
yellow.
- Long-running shell instances/idle shell sessions can be terminated at any time to free up
resources.
Long-running shell instances/idle shell sessions can be terminated at any time to free up
resources.

#### Commands

Here is an overview of useful commands that you can run an Odoo.sh database terminal:
- odoo-bin shell : to open an Odoo shell
odoo-bin shell : to open an Odoo shell
`odoo-binshell`
- odoo-update : to update modules in the database
odoo-update : to update modules in the database
`odoo-update`
- odoosh-restart : to restart Odoo.sh services (http or cron)
odoosh-restart : to restart Odoo.sh services (http or cron)
`odoosh-restart`
- odoosh-storage : to check the storage usage of your instanceâs container filesystem
odoosh-storage : to check the storage usage of your instanceâs container filesystem
`odoosh-storage`
- psql : to open a database shell
psql : to open a database shell
`psql`
- mutt : to check how emails appear on text clients (staging and development instances)
mutt : to check how emails appear on text clients (staging and development instances)
`mutt`
- lnav ~/logs/odoo.log : to navigate in your instanceâs odoo.log file
lnav ~/logs/odoo.log : to navigate in your instanceâs odoo.log file
`lnav~/logs/odoo.log`
`odoo.log`
- ncdu : to launch the disk usage analyzer with an interactive interface
ncdu : to launch the disk usage analyzer with an interactive interface
`ncdu`
- grep : to filter and find information in log or configuration files
grep : to filter and find information in log or configuration files
`grep`

### Editor

Clicking Editor opens a new browser tab to access an online integrated development
environment (IDE) to edit the source code. You can also open terminals, Python consoles, and Odoo
shell consoles.
You can open multiple tabs and drag and drop them to arrange the layout as you wish.
Online editor documentation .

### Monitor

The Monitor tab displays various performance monitoring metrics of the current build.
Zoom in with your cursor to adjust the time range or select it manually from the time range
selector. It is also possible to change the time zone.
- Technical logs always use the UTC . To analyze these logs
together with your monitoring metrics, ensure UTC is
selected in the monitoring tool.
Technical logs always use the UTC . To analyze these logs
together with your monitoring metrics, ensure UTC is
selected in the monitoring tool.
- Similarly, when sending a support ticket, ensure the information you share is based on UTC , as Odoo uses this time zone to investigate
performance issues.
Similarly, when sending a support ticket, ensure the information you share is based on UTC , as Odoo uses this time zone to investigate
performance issues.
The information is aggregated periodically. When this is the case, a blue dotted line is displayed,
along with the tag Aggregate Date . This means that the data before this date will appear
flattened when compared to the data after this date. Therefore, when using the monitoring tool, it
is recommended to focus on recent events to get the most detailed information possible.
Dotted Lines of other colors help you relate to other changes on the build (database import,
git push, etc.).
On each graph, an ð ( information ) icon is displayed in the top-left corner. Hover
your mouse over it to get more details about what the graph represents.

#### Metrics

The Memory graph displays information about memory consumption:
- Memory container represents Odoo workers and container processes.
Memory container represents Odoo workers and container processes.
- Memory postgresql represents the database.
Memory postgresql represents the database.
The CPU graph displays information about CPU consumption:
- CPU http represents Odoo workers.
CPU http represents Odoo workers.
- CPU cron/mail represents scheduled actions and incoming emails.
CPU cron/mail represents scheduled actions and incoming emails.
- CPU postgresql (database processes)
CPU postgresql (database processes)
- CPU other represents webshells, the editor, etc.
CPU other represents webshells, the editor, etc.
The Storage graph displays information about the storage used:
- Container represents the filestore, log files, and user files.
Container represents the filestore, log files, and user files.
- Postgresql represents the database and indexes.
Postgresql represents the database and indexes.
The Requests graph displays information about the number of HTTP requests per second:
- HTTP successes represents successful requests.
HTTP successes represents successful requests.
- HTTP errors represents failed requests (check odoo.log ).
HTTP errors represents failed requests (check odoo.log ).
`odoo.log`
- HTTP rate limited represents declined requests, possibly due to lack of workers.
HTTP rate limited represents declined requests, possibly due to lack of workers.
The Concurrent requests (max) graph displays the maximum number of concurrent HTTP
requests per second.
Database workers determine the number of concurrent requests that can be managed simultaneously.
It is essential to have enough workers to handle all incoming requests as they arrive. However,
having additional workers beyond this does not improve the speed at which requests are processed.
The Average Response time displays the average response time to HTTP requests (in
milliseconds).
The Incoming graph displays data about the daily number of incoming emails:
- Received Emails represents emails successfuly received.
Received Emails represents emails successfuly received.
- Received Emails bounced represents emails unsuccessfully received.
Received Emails bounced represents emails unsuccessfully received.
The Outgoing graph displays data about the daily number of outgoing emails:
- Sent Emails represents emails successfully sent.
Sent Emails represents emails successfully sent.
- Sent Emails bounced represents emails unsuccessfully sent.
Sent Emails bounced represents emails unsuccessfully sent.

### Logs

The Logs tab offers a real-time view of your serverâs logs.
Different logs are available:
- pip.log : the Python dependencies installation
pip.log : the Python dependencies installation
`pip.log`
- install.log : the database installation (for development branches, tests are included)
install.log : the database installation (for development branches, tests are included)
`install.log`
- odoosh-import-database.log : the last imported dump process
odoosh-import-database.log : the last imported dump process
`odoosh-import-database.log`
- odoo.log : the running server
odoo.log : the running server
`odoo.log`
- update.log : the database updates
update.log : the database updates
`update.log`
- pg_slow_queries.log : psql queries that take an unusual amount of time
pg_slow_queries.log : psql queries that take an unusual amount of time
`pg_slow_queries.log`
- sh_webshell.log :  the actions taken in the webshell
sh_webshell.log :  the actions taken in the webshell
`sh_webshell.log`
- sh_editor.log : the actions taken in the editor
sh_editor.log : the actions taken in the editor
`sh_editor.log`
- neutralize.log : the neutralization of the database (only staging)
neutralize.log : the neutralization of the database (only staging)
`neutralize.log`
When new lines are added to the logs, they are displayed automatically. If you scroll to the bottom,
the browser scrolls automatically each time a new line is added.
You can pause the logs fetching process by clicking the ( pause ) button
in the upper right corner. Otherwise, the process stops after five minutes. You can restart it by
clicking the ( play ) button.

### Backups

The Backups tab lists the available backups to download and restore, lets you perform a
manual backup and import a database.
The production database is automatically backed up daily. Seven daily, four weekly, and three
monthly backups are kept. Each backup includes the database dump, the filestore (attachments and
binary fields), logs, and sessions.
You can refer to the estimated scheduling of automatic backups to gain a better understanding of how the system works. This file is updated daily, taking the
current day as the departure point.
Staging and development databases are not automatically backed up. However, you can restore a backup
of the production database in your staging branches, for testing purposes, or manually recover data
that has been accidentally deleted from the production database.
The list contains the backups kept on the server of your production database. This server only keeps
one month of backups: seven daily and four weekly backups.
Dedicated backup servers keep the same backups, as well as three additional monthly backups. To
restore or download one of these monthly backups, contact Odoo Support .
When merging a commit updating the version of one or several modules (in __manifest__.py ),
or their linked Python dependencies (in requirements.txt ), then Odoo.sh performs an
automatic backup (flagged with type Update in the list), as either the container will be changed
by the installation of new pip packages, either the database itself will be changed with the module
update triggered afterwards. In these two cases, a backup is triggered as it may break something.
`__manifest__.py`
`requirements.txt`
`Update`
If the merged commit does not update the version of a module or linked dependencies, then no backup
is triggered by Odoo.sh, as neither the container nor the database is modified; therefore, the
platform considers this safe enough. As an extra precaution, you can make a manual backup before
modifiyng production sources.
The purpose of manual backups is to create a specific snapshot of production or staging databases
(not available for development). These remain available for seven days. However, there is a limit of
five daily manual backups.
The Import Database feature accepts database archives from:
- the standard Odoo database manager (available for on-premise Odoo servers under /web/database/manager )
the standard Odoo database manager (available for on-premise Odoo servers under /web/database/manager )
`/web/database/manager`
- the Odoo Online databases manager
the Odoo Online databases manager
- the Odoo.sh Backups tab (using the ( Download Options )
button)
the Odoo.sh Backups tab (using the ( Download Options )
button)
- the Odoo.sh Builds view (by clicking Download DB dump )
the Odoo.sh Builds view (by clicking Download DB dump )

### Upgrade

The Upgrade tab can be used to upgrade production and staging branches of valid
projects. For more information about the upgrade process, refer to the Upgrade documentation .

### Tools

The Tools tab contains the code profiler. It is used to start a profiling session,
recording the activities of Odoo workers running in the instance for a maximum of five minutes. You
can choose to terminate the session earlier, as running the tool for a shorter duration reduces the
amount of noise in the report.
After each session, an interactive flame graph is created to help you visualize how the Odoo workers
allocate their time.
Running the profiler consumes a lot of server resources, so avoid letting it run for too long.
The goal is to record a specific action in your database.

### Settings

The Settings tab lists the configuration options available for the currently selected
branch. The options vary for each stage.

#### Behavior upon new commits

You can change the branchâs behavior upon receiving a new commit for development and staging branches.
By default, a development branch creates a new build and a staging branch updates the previous
build. This is useful if the feature you are working on requires a specific configuration, as you
would not need to manually configure it again after every commit.
If you select New build for a staging branch, a fresh copy of the production build
is created every time a commit is pushed.
A branch that is moved from staging to development is set automatically to Do
nothing .

#### Module installation

You can choose which modules should be installed automatically for development branches.
To change the default behavior, untick the Use Default option under Development build behavior and select one of the following options under Module Installation :
- Install only my modules (does not include submodules) : only installs the branchâs
modules, excluding submodules . This is the default option.
Install only my modules (does not include submodules) : only installs the branchâs
modules, excluding submodules . This is the default option.
- Full installation (no test suite) : installs the branchâs modules, submodules, and all
standard Odoo modules. When running the full installation, the test suite is disabled.
Full installation (no test suite) : installs the branchâs modules, submodules, and all
standard Odoo modules. When running the full installation, the test suite is disabled.
- Install a list of modules : installs the specified modules. To do so, enter their
technical name, and separate them using commas (e.g., sale_management,website,accountant ).
Install a list of modules : installs the specified modules. To do so, enter their
technical name, and separate them using commas (e.g., sale_management,website,accountant ).
`sale_management,website,accountant`
If the test suite is enabled, installing all standard Odoo modules can take up to one hour.

#### Test suite

By default, the test suite for development branches is enabled. You can restrict which tests are
run by entering test tags and separating them using
commas (e.g., custom_tags,at_install,post_install ).
`custom_tags,at_install,post_install`
To disable the test suite entirely, untick Validate the test suite on new builds .

#### Odoo version

You can change the version of Odoo for development branches, for example, to test upgraded code
or develop features while your production database is in the process of being upgraded to a newer
version, by selecting another Version .
By default, Latest is selected as the Revision , and the sources of your Odoo
server are updated weekly automatically to benefit from the latest bug, security, and performance
fixes.
To choose a specific revision instead, select it using the Revision field.
Revisions expire after three months. You will be notified by email when the revisionâs expiration
date approaches. If you have not taken any action when it expires, the Revision field
is automatically set back to Latest .

#### Custom domains

You can configure additional <name>.odoo.com domains or your own custom domains for all branch
types.
`<name>.odoo.com`
To use your own custom domain, it is necessary to:
- Own or purchase the domain name.
Own or purchase the domain name.
- Enter the domain name under Custom domains (e.g., www.mycompany.com ), then click Add domain .
Enter the domain name under Custom domains (e.g., www.mycompany.com ), then click Add domain .
`www.mycompany.com`
- Configure the domain name (e.g., www.mycompany.com ) using your registrarâs domain name manager
with a CNAME record value set to your production database domain name (e.g., mycompany.odoo.com ).
Configure the domain name (e.g., www.mycompany.com ) using your registrarâs domain name manager
with a CNAME record value set to your production database domain name (e.g., mycompany.odoo.com ).
`www.mycompany.com`
`mycompany.odoo.com`
Bare domains (e.g., mycompany.com ) are not accepted. They can only be configured using A records, which only accept IP addresses as their value. Therefore, a bare domain could suddenly
cease to function, as the IP address of a database can change (e.g., following an upgrade, a
hardware failure, a change of database hosting location).
`mycompany.com`
To have both your bare domain (e.g., mycompany.com ) and www domain (e.g., www.mycompany.com )
working, it is necessary to redirect the bare domain to the www domain. .com. Most domain managers
provide a way to configure this redirection, commonly referred to as a web redirection.
`mycompany.com`
`www.mycompany.com`
If the redirection is correctly set up, an SSL certificate is automatically generated using Letâs
Encrypt within the hour, meaning your domain will be accessible
through HTTPS.
If the domain of your email addresses uses the SPF or DKIM authentication protocol, it is necessary to authorize Odoo as a
sending host in the domain name settings to increase the deliverability of outgoing emails. For more
information, refer to the Configure DNS records to send emails in Odoo documentation .
If Odoo is not authorized as a sending host, your outgoing emails may be flagged as spam.

## Shell commands

In the top right corner of the view, several shell commands are displayed. The commands can be
copied using the clipboard button and then used in a terminal. In addition, some of them can be used
directly from Odoo.shâs interface.

### Clone

The clone command is used to create a local copy of your Git repository.
- --recurse-submodules to download the submodules of your repository
--recurse-submodules to download the submodules of your repository
`--recurse-submodules`
- --branch main to check out to a specific branch of the repository (e.g., development )
--branch main to check out to a specific branch of the repository (e.g., development )
`--branchmain`
`development`
The run button is not available as the command is used to create a local copy on your machine.

### Fork

The fork command is used to create a new branch based on the current one.
- git checkout -b main-1 main a command to create a new branch (e.g., development-1 )
based on the current branch (e.g., development )
git checkout -b main-1 main a command to create a new branch (e.g., development-1 )
based on the current branch (e.g., development )
`gitcheckout-bmain-1main`
`development-1`
`development`
- git push -u origin development-1 a command to upload the new branch (e.g., development-1 ) to the remote repository
git push -u origin development-1 a command to upload the new branch (e.g., development-1 ) to the remote repository
`gitpush-uorigindevelopment-1`
`development-1`

### Merge

The merge command is used to combine changes on one branch into another branch.
- git merge staging-1 a command to merge the changes of the current branch into
another branch (e.g., staging-1 )
git merge staging-1 a command to merge the changes of the current branch into
another branch (e.g., staging-1 )
`gitmergestaging-1`
`staging-1`
- git push -u origin staging a command to upload the merged changes to the remote
repository branch (e.g., staging )
git push -u origin staging a command to upload the merged changes to the remote
repository branch (e.g., staging )
`gitpush-uoriginstaging`
`staging`

### SSH

The SSH command is used to connect to a build using SSH.
To use the SSH command, it is necessary to set up an SSH key first. To do so:
- Generate a new SSH key .
Generate a new SSH key .
- Copy the SSH key to your clipboard .
Copy the SSH key to your clipboard .
- On Odoo.sh, click your GitHub user in the top-right corner and select Profile .
On Odoo.sh, click your GitHub user in the top-right corner and select Profile .
- Paste the SSH key under the Add a key manually field and click Add .
Paste the SSH key under the Add a key manually field and click Add .
- 25004381 the build ID
25004381 the build ID
`25004381`
- my-user-my-repository-staging-25004381.dev.odoo.com the domain used to connect to the build
my-user-my-repository-staging-25004381.dev.odoo.com the domain used to connect to the build
`my-user-my-repository-staging-25004381.dev.odoo.com`
Provided you have the necessary access rights on the
project, you will be granted SSH access to the build.
Long-running SSH connections are not guaranteed. Idle connections can be disconnected to free up
resources.

### Submodule

The submodule command is used to add a branch from another repository to your current branch as a
submodule.
Submodules documentation
- git submodule add -b master <URL> <PATH> a command to add a specific branch (e.g., master ) of a repository ( <URL> ) as a submodule under the specified path ( <PATH> ) in
your current branch.
git submodule add -b master <URL> <PATH> a command to add a specific branch (e.g., master ) of a repository ( <URL> ) as a submodule under the specified path ( <PATH> ) in
your current branch.
`gitsubmoduleadd-bmaster<URL><PATH>`
`master`
`<URL>`
`<PATH>`
- git commit -a a command to commit all current changes
git commit -a a command to commit all current changes
`gitcommit-a`
- git push -u origin staging a command to upload the changes of the current branch
(e.g., staging ) to the remote repository.
git push -u origin staging a command to upload the changes of the current branch
(e.g., staging ) to the remote repository.
`gitpush-uoriginstaging`
`staging`

### Delete

The delete command is used to delete a branch from your repository.
Once you delete a branch, there is no way to retrieve it unless a backup exists. Staging branches
are not automatically backed up, but can be manually. Development branches cannot be backed up.
- git push origin :staging a command to delete a specific branch (e.g., staging ) on
the remote repository
git push origin :staging a command to delete a specific branch (e.g., staging ) on
the remote repository
`gitpushorigin:staging`
`staging`
- git branch -D staging a command to delete the specific branch on your local copy of
the repository
git branch -D staging a command to delete the specific branch on your local copy of
the repository
`gitbranch-Dstaging`
Before deleting a branch, refer to the Backups section to
better understand how they work and when you should create a manual backup.

Stages
Production
Staging
Development
Merging branches
Tabs
History
Mails
Shell
Editor
Monitor
Logs
Backups
Upgrade
Tools
Settings
Shell commands
Clone
Fork
Merge
SSH
Submodule
Delete


Builds

# Builds

In Odoo.sh, a build is a database loaded by an Odoo server ( odoo/odoo and odoo/enterprise )
running on a specific revision of your project repository in a containerized environment. Its
purpose is to test the proper behavior of the server, the database, and the features associated with
that revision.

## Overview

In the Builds view, a row represents a branch, and a cell within that row represents
a build of that branch.
Most builds are created after pushes to your GitHub repository branches. They can also be created
through other operations, such as importing a database on Odoo.sh or requesting a rebuild for a
branch in your project.
Builds can have three possible statuses:
- A build is considered successful if no errors or warnings occur during its creation.
Successful builds are highlighted in green .
A build is considered successful if no errors or warnings occur during its creation.
Successful builds are highlighted in green .
- A build is considered almost successful if warnings occur, but there are no errors. Almost
successful builds are highlighted in yellow .
A build is considered almost successful if warnings occur, but there are no errors. Almost
successful builds are highlighted in yellow .
- A build is considered failed if errors occur during its creation. Failed builds are
highlighted in red .
A build is considered failed if errors occur during its creation. Failed builds are
highlighted in red .
Builds do not always create a database from scratch. For instance, when pushing a change on the
production branch, the created build starts the server with your new revision and tries to load
the current production database on it.

## Stages

### Production

The first build of a production branch creates a database from scratch. If this build is successful,
this database will become the production database of your project.
From then on, pushes to the production branch will create new builds that attempt to load the
database using a server running the new revision.
If the build is successful or almost successful, the production database will run with this build
and its associated revision.
If the build fails to load or update the database, the previous successful build is reused to load
the database. In that case, the database continues to run using the previous successful revision.
The build used to run the production database is always the first in the builds list. If a build
fails, it is placed after the build currently running the production database.

### Staging

Staging builds duplicate the production database and attempt to load this copy using the revisions
of the staging branches.
Each time you push a new revision to a staging branch, the resulting build uses a fresh copy of the
production database. Databases are not reused between builds of the same branch. This ensures that:
- Staging builds use databases that closely match the current production state, so your tests are
not performed on outdated data.
Staging builds use databases that closely match the current production state, so your tests are
not performed on outdated data.
- You can freely experiment within a staging database. When you want to start over with a new copy
of the production database, you can request a rebuild.
You can freely experiment within a staging database. When you want to start over with a new copy
of the production database, you can request a rebuild.
However, this also means that if you make configuration changes in a staging database and do not
apply them in production, those changes will not be present in the next build of the same staging
branch.

### Development

Development builds create new databases, load the demo data, and run the unit tests.
A build will be considered failed if tests fail during installation, as they are designed to raise
errors when something is wrong.
If all tests pass and no errors occur, the build is considered successful.
Depending on the list of modules to install and test, a development build can take up to one hour
to be ready. This is due to the large number of tests included in the default Odoo module suite.

## Features

The production branch always appears first. Other branches are ordered by the time of their last
created build. The stage highlighted in purple corresponds to the stage selected in the Branches menu.
You can filter branches using the search bar.
For each branch, you can:
- Access the latest buildâs database by clicking Connect .
Access the latest buildâs database by clicking Connect .
- Jump to the branchâs code by clicking Github .
Jump to the branchâs code by clicking Github .
- Create a new build by clicking Rebuild . It uses the latest revision of the branch (it
is not available if a build is already in progress for that branch).
Create a new build by clicking Rebuild . It uses the latest revision of the branch (it
is not available if a build is already in progress for that branch).
For each build, you can:
- View the revision changes by clicking the ( GitHub ) icon.
View the revision changes by clicking the ( GitHub ) icon.
- Access the buildâs database as the administrator by clicking Connect or as another
user by clicking the ( More Actions ) button next to Connect and selecting Connect as .
Access the buildâs database as the administrator by clicking Connect or as another
user by clicking the ( More Actions ) button next to Connect and selecting Connect as .
- Access the same tools as in the branches view by clicking the ( More Actions ) button next to Connect and selecting Logs , Web Shell , Editor , Outgoing e-mails (for the staging and
development stages), Monitoring , and Download DB dump (for the production
and staging stages).
Access the same tools as in the branches view by clicking the ( More Actions ) button next to Connect and selecting Logs , Web Shell , Editor , Outgoing e-mails (for the staging and
development stages), Monitoring , and Download DB dump (for the production
and staging stages).

Overview Stages Production Staging Development Features


Create a project

# Create a project

## Deploy a platform

- Visit Odoo.sh and click Deploy your platform .
Visit Odoo.sh and click Deploy your platform .
- Sign in with a GitHub account.
Sign in with a GitHub account.
- Authorize Odoo.sh by clicking Authorize odoo twice. Note Odoo.sh requests GitHub to: Access your GitHub login and email. Create a new repository, in case you start from scratch. Access existing repositories, including organization ones, in case you start from an
existing repository. Create a webhook to notify you each time changes are pushed. Commit changes for easier deployment.
Authorize Odoo.sh by clicking Authorize odoo twice.
Odoo.sh requests GitHub to:
- Access your GitHub login and email.
Access your GitHub login and email.
- Create a new repository, in case you start from scratch.
Create a new repository, in case you start from scratch.
- Access existing repositories, including organization ones, in case you start from an
existing repository.
Access existing repositories, including organization ones, in case you start from an
existing repository.
- Create a webhook to notify you each time changes are pushed.
Create a webhook to notify you each time changes are pushed.
- Commit changes for easier deployment.
Commit changes for easier deployment.
- Fill in the Deploy your platform form and click Deploy : Github repository : to create a new repository, choose New repository and enter a name; to use an existing one, choose Existing repository and select it. Odoo Version : select the major version of Odoo you want to use. Tip Use the latest major version of Odoo version when creating a new repository. If you are
planning to import an existing database or applications, it might be required that their
versions match. If you are starting on Odoo Online and plan to migrate to Odoo.sh later, create your
database using odoo.com/start-lts to ensure
compatibility, as minor versions are not supported by Odoo.sh. Subscription Code : enter your Odoo Enterprise subscription code that includes
Odoo.sh. It is also sometimes called the subscription referral , contract number , or activation code . Tip Partners can use their partnership codes to initiate a trial (trial builds are limited to 1
GB storage and two staging). If a client proceeds to start a project, they must subscribe
to an Odoo Enterprise plan that includes Odoo.sh hosting and use their subscription code. Hosting location : select the region where your platform will be hosted.
Fill in the Deploy your platform form and click Deploy :
- Github repository : to create a new repository, choose New repository and enter a name; to use an existing one, choose Existing repository and select it.
Github repository : to create a new repository, choose New repository and enter a name; to use an existing one, choose Existing repository and select it.
- Odoo Version : select the major version of Odoo you want to use. Tip Use the latest major version of Odoo version when creating a new repository. If you are
planning to import an existing database or applications, it might be required that their
versions match. If you are starting on Odoo Online and plan to migrate to Odoo.sh later, create your
database using odoo.com/start-lts to ensure
compatibility, as minor versions are not supported by Odoo.sh.
Odoo Version : select the major version of Odoo you want to use.
- Use the latest major version of Odoo version when creating a new repository. If you are
planning to import an existing database or applications, it might be required that their
versions match.
Use the latest major version of Odoo version when creating a new repository. If you are
planning to import an existing database or applications, it might be required that their
versions match.
- If you are starting on Odoo Online and plan to migrate to Odoo.sh later, create your
database using odoo.com/start-lts to ensure
compatibility, as minor versions are not supported by Odoo.sh.
If you are starting on Odoo Online and plan to migrate to Odoo.sh later, create your
database using odoo.com/start-lts to ensure
compatibility, as minor versions are not supported by Odoo.sh.
- Subscription Code : enter your Odoo Enterprise subscription code that includes
Odoo.sh. It is also sometimes called the subscription referral , contract number , or activation code . Tip Partners can use their partnership codes to initiate a trial (trial builds are limited to 1
GB storage and two staging). If a client proceeds to start a project, they must subscribe
to an Odoo Enterprise plan that includes Odoo.sh hosting and use their subscription code.
Subscription Code : enter your Odoo Enterprise subscription code that includes
Odoo.sh. It is also sometimes called the subscription referral , contract number , or activation code .
Partners can use their partnership codes to initiate a trial (trial builds are limited to 1
GB storage and two staging). If a client proceeds to start a project, they must subscribe
to an Odoo Enterprise plan that includes Odoo.sh hosting and use their subscription code.
- Hosting location : select the region where your platform will be hosted.
Hosting location : select the region where your platform will be hosted.

## Import a database

Once your platform is deployed, you can import a database into your Odoo.sh project, provided it
uses a supported version of Odoo.
Due to Odooâs backup policy , the import process requires four times the size of your database dump in available storage. For example, a 10 GB dump
file will require at least 40 GB of available space. We recommend allocating more than four
timesÃ the dump size temporarily, then reducing storage after the import is complete.
If your project is a trial created with a partnership code, you can only import database dumps up
to 1 GB in size.

### Push modules in production

If you are using community or custom modules, add them to a branch in your GitHub repository.
Databases hosted on Odoo Online do not support custom modules.
Odoo.sh automatically detects folders containing Odoo modules. You can organize them however you
prefer. For example, you can place them directly in the root directory of your repository or group
them by category (e.g., accounting , project , etc.).
`accounting`
`project`
For publicly available community modules, you may also consider using submodules .

### Download a backup

Go to /web/database/manager on your on-premise Odoo instance and click Backup .
`/web/database/manager`
Select zip (includes filestore) as the Backup Format .
- You will need the Master Password of your Odoo server. If you do not have it,
contact your system administrator.
You will need the Master Password of your Odoo server. If you do not have it,
contact your system administrator.
- If you cannot access the database manager, it may have been disabled by your system
administrator. Refer to the database manager security documentation .
If you cannot access the database manager, it may have been disabled by your system
administrator. Refer to the database manager security documentation .
Log in to your portal account and navigate to the My Databases page , and download a backup by clicking the ( gear ) icon, then Download .
Only major versions of Odoo are compatible with Odoo.sh.

### Upload the backup

In your Odoo.sh project, navigate to the Backups tab of your Production branch, and click Import Database to upload the backup you previously downloaded.
Once the import is complete, you can access the database using the Connect button in the
branchâs History tab.
Importing a backup overwrites all data currently in the branch. Consider downloading a manual
backup beforehand if you want to preserve the existing data.

### Check outgoing email servers

Odoo.sh provides a default email server. To use it, ensure that no outgoing mail server is
enabled in your database by enabling developer mode and navigating to Settings â£ Technical â£ Email: Outgoing Mail Servers
After importing your database, all configured outgoing mail servers are disabled , and the
default Odoo.sh server is used.
Port 25 is and will remain closed. If connecting to an external SMTP server, use port 465 or 587 .

### Check scheduled actions

Scheduled actions are disabled by default after importing your database. This prevents your
newly imported database from performing potentially disruptive operations such as:
- sending queued emails,
sending queued emails,
- triggering mass mailings, or
triggering mass mailings, or
- syncing with third-party services (e.g., calendars, cloud storage).
syncing with third-party services (e.g., calendars, cloud storage).
If you intend to use this imported database in production, re-enable only the scheduled actions
you need by enabling developer mode and going to Settings
â£ Technical â£ Automation: Scheduled Actions .

### Register the subscription

After import, the database is considered a duplicate and will be unlinked from your enterprise
subscription.
You are allowed only one active database per subscription.
If you intend to make the imported database your production environment:
- Unlink your previous database from the subscription.
Unlink your previous database from the subscription.
- Register the new one.
Register the new one.
Refer to the database registration documentation for step-by-step
instructions.

Deploy a platform
Import a database
Push modules in production
Download a backup
Upload the backup
Check outgoing email servers
Check scheduled actions
Register the subscription