How it works...

An Odoo module is a directory that contains code files and other assets. The directory name that's used is the module's technical name. The name key in the module manifest is its title.

The __manifest__.py file is the module manifest. This contains a Python dictionary with module metadata like category, version, the modules it depends on, and a list of the data files that it will load. In this recipe, we used a minimal manifest file, but in real modules, we will need other important keys. These are discussed in the next recipe, Completing the add-on module manifest.

The module directory must be Python-importable, so it also needs to have an __init__.py file, even if it's empty. To load a module, the Odoo server will import it. This will cause the code in the __init__.py file to be executed, so it works as an entry point to run the module Python code. Due to this, it will usually contain import statements to load the module Python files and submodules.

Known modules can be installed directly from the command line using the --init or -i option. This list is initially set when you create a new database from the modules found on the add-ons path provided at that time. It can be updated in an existing database with the Update Module List menu.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset