In this blog, we are going to discuss the contents of the __manifest__.py in a module. As we know the manifest file is one of the basic building blocks on an Odoo module. The basic information about the module is stored inside the __manifest__.py file.
Now we can look at the contents of the manifest file and their usage in Odoo module development.
Manifest file naming
For the older version ie, Odoo 9.0 and below versions use the file name __openerp__.py
For the versions above Odoo, 9.0 ie from Odoo 10.0 to latest (Odoo 13.0) use the file __manifest__.py
Important keys in the manifest file:
{
'name': 'Sale Discount Control',
'version': '12.0.1.0.0',
'sequence': 30,
'summary': 'Discount Control in Sale',
'description': """
Discount Control module allows you to seamlessly control discount in
sales order line and invoice order line. The module provisions you to
add discount for a product as soon as you enter a product in the order
can approve the discount """,
'author': 'Cybrosys Techno Solutions',
'company': 'Cybrosys Techno Solutions',
'website': 'https://www.cybrosys.com',
'maintainer': 'Cybrosys Techno Solutions',
'support': 'Cybrosys Techno Solutions',
'category': 'Sales',
'depends': [
'base',
'sale_management',
'account',
],
'data': [
'views/res_partner_view.xml',
'views/sale_order_view.xml',
'views/account_invoice_view.xml'
],
'css': ['static/src/css/web_example.css'],
'test': [],
'qweb': ['static/src/template.xml'],
'license': 'OPL-1',
'price': 19,
'currency': 'EUR',
'images': ['static/description/banner.png'],
'installable': True,
'application': True,
'auto_install': False,
'live_test_url': 'https://www.youtube.com/watch?v=gnGqiLrieYM',
}
Name (string, required)
This key indicates the non-technical name of the module, changing this name never affects the working of the module.
Version (string)
Major version format will be “Odoo major version.x.y.z”.
If a module is developed in version 13.0, the version in the manifest will be
‘version’: ‘13.0.1.0.0’,
Ie, X increments when any change happen in the data model or in case of a view,
Y increments when module upgrades needed situations to arise.
And Z increments when bug fixes are made.
Sequence
It will help with your module position in the module list.
’sequence’ : 12
Category(string, default: Uncategorized)
Categories are.
> Accounting
> Discuss
> Document Management
> eCommerce
> Human Resources
> Industries
> Localization
> Manufacturing
> Marketing
> Point of Sale
> Productivity
> Project
> Purchases
> Sales
> Warehouse
> Website
> Extra Tools
Summary(string)
A brief statement about the module
’summary’:’Module introduction’,
Description(string)
Long statement about the module functionality.
‘description’: ‘Description of the module’
Author(string)
In General module developed person will be the author.
'author’: ‘Cybrosys Techno Solutions’,
Website(string)
If a company or a developed person has a Website, that address will be on the website.
'website': ‘https://www.cybrosys.com’,
Maintainer(string)
A company or a person who is in charge to maintain this module. Generally, a developed person will be the maintainer also.
'maintainer': "Cybrosys Techno Solutions",
Support(string)
A company or person will be a supporter of the module.
‘support’: "Cybrosys Techno Solutions",
Depends(list(string))
When a module is installed, all of its dependencies are installed before it. Likewise, dependencies are loaded before a module is loaded.
‘depends’: [‘depended module name’]
Data(list(string))
List of data files that must always be installed or updated with the module. A list of paths from the module root directory.
‘data’:[’data_files.xml’]
Demo(list(string))
List of data files which are only installed or updated in demonstration mode
‘demo’:[’demo_files’]
Test(list(string))
All test yml files will be listed here. It will run on the basis of the server parameter when you start the odoo server.
‘test’:[‘test_file.yml’]
Css(list(string))
Here you can add css file, the file should be located in static/src/css.
License (str, defaults: LGPL-3)
Possible values for Licence:
1. GPL-2
2. GPL-3
3. AGPL-3
4. LGPL-3
5. OEEL-1 (Odoo Enterprise Edition License v1.0)
6. OPL-1 (Odoo Proprietary License v1.0)
7. Other proprietary
Qweb(list(string))
Normally javascript template file is recorded here. The file should be located in static/src/XML.
‘qweb’:’static/src/xml’
Images(list(string))
Here you can specify the image file used in your module. The file should be located in static/description/image.png
'images': ['static/description/banner.png']
Installable(boolean default: False)
Users should be able to install the module from the Web UI or not.
'installable': True,
Application(boolean default: False)
Whether the module should be considered as a fully-fledged application (True) or is just a technical module (False) that provides some extra functionality to an existing application module.
'application': True,
Currency(string)
The price currency will be specified here.
'currency': 'EUR',
Auto_install (bool, default: False)
If auto-install is True, the module will automatically get installed when all of its dependencies are installed.
Price(Integer)
If the module is a paid addon, the price will specify here.
'price': 200,
Live_test_url(string)
Specify the test URL of your server here.
'Live_test_url':'your video link',