Module Licensing Details

Format

  • A singular form in the module name recommended
  • Can use “multi”. Do not use plural forms(i.e., mrp_operations_..)
  • Base modules - prefix with base_ (i.e., base_location_..)
  • Localization module - prefix with l10n_CC_, (CC is Country Code) (i.e., l10n_us_..)
  • Extending a module – prefix yours with that module name (i.e., mail_forward)
  • Combining ODOO module with another form of OCA (like OCA partner name) – crm_partner_firstname, where;
            - CRM belongs to ODOO
            - partner_firstname belongs to OCA
  • Use description template, remove sections with no meaningful content
  • Don't use the company logo or any kind of corporate branding

Version Number

The version number in the manifest file is the ODOO major version (i.e., 8.0). It is further followed by the module version numbers in the form of x.y.z that follows the semantics breaking.feature.fix.

Example – 8.0.1.0.0, where:
  • 8.0 is the module
  • x increments when the data model or views had significant changes. It may need data migration or be depending on the modules, it might change
  • y increments when any non-breaking features are added. Majorly during module upgrade
  • z increments when the bug fixes are made. A server restart is needed to fix the bugs


The breaking changes must include instructions or scripts for performing the successful migration on current installations if needed.

Directories

Modules are organized within some directories:


  • Controllers/ : contains controllers (http routes)
  • Models/ : model definitions
  • Data/ : data XML
  • Views/ : contains the views and templates an Qweb report print templates
  • Static/ : contains the web assets, separated into css/, js/, img/, lib/
  • Demo/ : demo XML
  • Examples/ : external files
  • Wizards/ : wizard model and views
  • Report/ : reporting models (BI/analysis), Webkit/ RML print report templates

File Naming

Created or inherited files need to be split for models, views, and data declarations. These are named after model.
Example: res. partner file;
  • The demo data should be with a file named demo/res_partner.xml
  • The view data should go with a file named views/res_partner.xml
The Exception is allowed when the model is a model intended and going to be used as a one2many model nested on the main model. In such case, you may include the model definition inside it;
For the model named <main_model>, the following files may be created:
  • models/<main_model>.py
  • data/<main_model>.xml
  • demo/<main_model>.xml
  • views/<main_model>.xml
  • templates/<main_model>.xml

Installation Hooks

When pre_init_hook, post_init_hook, and uninstall_hook are used, by default they are located at thethe root of a module directory structure in hooks.py and keys in the manifest file as follows:

{
...
'pre_init_hook' : 'pre_init_hook',
'post_init_hook': 'post_init_hook',
'uninstall_hook': 'uninstall_hook',
...
}

While using this, remember to add into __init__.py and the following imports as needed.


Example :

...
from .hooks import pre_init_hook
from .hooks import post_init_hook
from .hooks import uninstall_hook
...