Odoo 12 Development Essentials
上QQ阅读APP看书,第一时间看更新

Creating a work database

By now, we should have a PostgreSQL database server and an Odoo server instance running. We now need to create an Odoo database before we can start working on our project.

If you installed Odoo locally, keeping the default configuration options, the server should be available at http://localhost:8069. When we access it for the first time, since there are no Odoo databases available yet, we should see an assistant to create a new database:

The information you need to provide is the following:

  • The Database Name is the identifier name to use for this database. You can have several databases available on the same server.
  • Email is the login username to use for the special Administrator super user. It doesn't have to be an actual email address.
  • Password is your secret password to log in as the Administrator.
  • Language is the default language to use for the database.
  • Country is the country set in the database's company data. It is optional, and is relevant for localization features in some apps, such as Invoicing and Accounting.
  • The load demonstration data checkbox allows you to create the database with demonstration data, instead of creating a clean database. This is usually desirable for development and test environments.

A master password field might also be asked for, if one was set in the Odoo server configuration. This allows you to prevent unauthorized people from performing these administrative tasks. But by default it is not set, so you probably won't be asked for it.

After pushing the create database button, the new database will be bootstrapped, a process that can take a couple of minutes, and once ready you are redirected to the login screen.

The login screen has a manage databases link at the bottom to access the database manager. There, you can see the list of available databases; back up, duplicate, or delete them; and also create new ones. It can also be directly accessed at http://localhost:8069/web/database/manager.

The database manager allows for privileged administration operations, and by default is enabled and unprotected. While it is a convenient feature for development, it can be a security risk for databases that have real data, even if they are test or development environments. Consider setting a strong master password, or even better, disabling it. This is done by setting  list_db = False in the server configuration file.

Now that we have an Odoo instance and a database to work with, the next step is to enable the developer mode, providing the tools we need to implement our project.