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

Installing a new module

We now have a minimal addon module. It doesn't do anything yet, but we want to install it just to check that everything is working properly so far.

For this to be possible, the addons directory where our module is should be known to the Odoo server. We can confirm that by stopping and starting the Odoo server, and looking at the server log outputin the first log lines, we should find one with the odoo: addons paths: text, followed by the list of active addons paths being used. For more details on how to set the addons paths, refer to Chapter 2, Preparing the Development Environment.

To install a new module, we should start the server using both the -d and -i options. -d ensures that we are working with the correct Odoo database. And -i accepts a comma-separated list of modules to install.

Assuming that our development database is called dev12, the command to use is:

$ ./odoo-bin -d dev12 -i library_app

Pay close attention to the server log messages to confirm that the module was found and installed. You should be able to see this specific message in the log: odoo.modules.registry: module library_app: creating or updating database tables.