Enable Dark Mode!
whats-inside-odoo-19-manifestpy.jpg
By: Safa KB

What’s inside Odoo 19 __manifest__.py

Technical Odoo 19 Odoo Enterprises Odoo Community

What is __manifest__.py?

Every custom module (or marketplace) in Odoo includes a module manifest, __manifest__.py, located in the root of the module folder. It is a Python file that defines a single dictionary containing metadata about the module (name, version, dependencies, data files, assets, etc.). It contains essential information related to your module; it tells Odoo what your module is, what it depends upon, and what files/data to load. In fact, a module will not even show up in the Apps list and will not install correctly at all without the manifest file.

Because it's the first place you look when developing or analyzing a module, a good manifest is the foundation of a good module.

The Importance of Manifest

  • Visibility - shows up (or not) in Apps based on fields like installable or application.
  • Dependencies - the depends list tells Odoo to install certain modules before yours.
  • Loading order & data management - example data, demo, & assets, etc., define what loads and in what order.
  • Quality & metadata - license, version, maintainer, summary, etc., all help you manage meta tags.

Common Fields found in __manifest__.py

Here is a (relatively comprehensive) compilation of fields you will find, along with explanations of their meanings, usage, and Odoo 19 information (where available). Note: In Odoo 19, some newer keys (especially around assets, web client, etc.) may be more commonly used, but the core has not changed.

  1. name
  2. The visible name of the module for users that will appear in their Apps list with the other modules they installed, e.g. 'Customer Portal Enhancements'. Changing the name does not generally change the module functionality, just the way the user sees it in the Apps list.

  3. version
  4. The version number of your module. The generally accepted convention for version numbers is: .... There are also many modules which use simpler version numbers than this. An example of a complete version number might look like this, '19.0.1.0.0'. This number will be useful to you for tracking when to upgrade the module.

  5. summary
  6. A brief one-liner summary of what the module does. This is helpful for the user for a quick glance of your module in their Apps list.

  7. description
  8. A description of the module which includes some detail explaining what it does, any features, and the business benefit of the module. You may also use a multi-line string here to make your description look nice.

  9. category
  10. The business domain or folder that the module belongs under (e.g., 'Sales', 'Human Resources', 'Inventory / Warehouse'). This helps users to filter the modules in the Apps list.

  11. author
  12. The name of the author and/or company that developed the module.

  13. website
  14. A URL for the author/company documentation of the module.

  15. license
  16. The license type under which the module is distributed (e.g., 'LGPL-3', 'AGPL-3', 'OPL-1', etc). LGPL-3 is the default for many modules.

  17. depends
  18. A list of technical module names that your module depends on. Odoo will make sure that these modules are installed before installing your module. For example, if you inherited some models/views from sale, you would need to list the name of the sale module here.

  19. application
  20. Indicates if the module is a full application (True) or a technical add-on (False), which influences how it appears in Apps.

  21. auto_install
  22. Module auto-installs if True when dependencies install. If a list, install when dependencies in list are fulfilled.

  23. sequence
  24. Used for ordering modules/social display in Apps (lower numeric value displays first). Sequence is often optional.

  25. external_dependencies
  26. Enumerates external system/python dependencies by keys 'python' (list of Python packages) or 'bin' (list of executables) required to exist on the system prior to install of the repository module.

  27. assets
  28. Defines asset bundles and file lists for modules that include web frontend/backend assets (JS/CSS). This is much more applicable in recent Odoo versions (like 19).

Example Manifest for Odoo 19

Below is an example of a your__manifest__.py so you can see in one place, a minimal Odoo 19 module named "My Custom Module":

# -*- coding: utf-8 -*-
{
   'name': "My Custom Module",
   'version': '19.0.1.0.0',
   'summary': "Adds an approval workflow to the sales order process",
   'description': """
       This module adds an approval workflow to the sales order,
       and provides multi-level validation, notification and dashboard.
   """,
   'category': 'Sales',
   'author': "Your Company",
   'website': "https://www.yourcompany.com",
   'license': 'LGPL-3',
   'depends': ['base', 'sale_management', 'mail'],
   'data': [
'security/ir.model.access.csv',
       'views/sale_order_approval_views.xml',
       'data/sale_order_approval_data.xml',
   ],
   'demo': [
       'demo/demo_sale_order_approval.xml',
   ],
      'installable': True,
   'application': True,
   'auto_install': False,
   'assets': {
       'web.assets_backend': [
           'my_custom_module/static/src/js/sale_order_approval.js',
           'my_custom_module/static/src/css/sale_order_approval.css',
       ],
   },
}

Conclusion

The __manifest__.py file can seem trivial, as it appears to be just a dictionary but, in fact, it may be considered the most important file of your custom module. It serves as the module's identity card, dependency reference, install guide, and metadata profile. In Odoo 19 module development, spending a few minutes to create a clean, accurate, and professional manifest will pay off in huge ways (ease of installation, fewer bugs, better maintainability, and better visibility on the marketplace).

To read more about How to Create an Advanced Selection Field in Odoo 19, refer to our blog How to Create an Advanced Selection Field in Odoo 19.


If you need any assistance in odoo, we are online, please chat with us.



0
Comments



Leave a comment



whatsapp_icon
location

Calicut

Cybrosys Technologies Pvt. Ltd.
Neospace, Kinfra Techno Park
Kakkancherry, Calicut
Kerala, India - 673635

location

Kochi

Cybrosys Technologies Pvt. Ltd.
1st Floor, Thapasya Building,
Infopark, Kakkanad,
Kochi, India - 682030.

location

Bangalore

Cybrosys Techno Solutions
The Estate, 8th Floor,
Dickenson Road,
Bangalore, India - 560042

Send Us A Message