KEMBAR78
Odoo 15 Composition of Module | PPTX
Composition of
Module in Odoo 15
www.cybrosys.com
INTRODUCTION
This slide describes the various components of an odoo module. It discusses controllers, data,
docs, translations, reports, security, static files and folders, unit tests, views, and wizards.
❖ An Odoo module contains a number of elements, Each module build as a technical
name, here it is named as ‘my_module’. When we open the ‘my_module’ directory in the
pycharm we can see many more folders.
❖ Each module contains required python files, they are ‘__init__.py’ and ‘__manifest__.py’
file.
❖ __init__.py
In the __init__.py file, we have to import all the python files that we are going to use. Suppose
as described above we have a python file called model.py in our module. The first thing we
have to do is, import the model.py in the __init__.py file.So our __init__.py file will be like this,
➢ __manifest__.py
In the __manifest__.py, We have to mention the module name, the author name, version,
description, company, category, etc. Now let us see what all these things for,
* Name – Name of the module to be displayed.
Version – version of the released module.
* Summary – Summary for the module.
* Category – Category of the module, whether it is sales, purchase, the point of sale etc.
* depends – Suppose if our module depends on any other modules, we have to mention that
name in the depends. As we are going to create a new module and as it is not depending on
any other modules, just add depends as the base.
* data – In the data section, we have to specify all the .xml files here. In our case, we have to
mention the view.xml
❖ So our __manifest__.py file will be like this,
,
❖ Then Let’s discuss about each components,
➢ Controllers : It is web controllers, which is used for the front-end and back-end of the
action views. And it requests from the web browsers, Inside the controllers we can see
the ‘__init__.py’ file and ‘controllers.py’ file. In the ‘__init__.py’ file it will load or import
the ‘controllers.py’. And the ‘controllers.py’ file which render the request to show the
website.
 demo : Here we have to add ‘demo.xml’ file, which are loaded in the demonstration mode.
For eg, If we need to load a contact details while we installing the module those contact
details can be added in the ‘demo.xml’ file. So, the ‘demo.xml’ file uploaded while we
installing the module.
➢ doc: Here we have to add like ‘.pdf’, ‘.txt’ file. Here we can update documents related to
this module.
➢ i8n: This is for internationalization, it can be user to add translation to your modules. It
consist of ‘.po’ file, For eg, If the user is using arabic language, he needs its fields, labels or
things in arabic, we can load the fields name in arabic in the ‘.po’ files. And ‘po’ can be
obtained by exporting the custom modules.
joijjjjj
➢ models: Here we can declared the business objects. It also contains an ‘__init__.py’ and
‘models.py’ file. ‘__init__.py’ file which loads the ‘models.py’ file. Here we can add more
functionality and new features to our business.
➢ reports: All the files that relate to reports will be included in the report directory. We can create
different reports in Odoo. A report contains 2 elements:
ir.actions.report: which defines different parameters for the report.
Qweb view: We can render the reports using different elements in qweb.
The reports directory also contains a ‘__init__.py’ and python file named as ‘reports.py’ file. And
the ‘__init__.py’ file also load the ‘reports.py’ file in the report.
 security: All security-related files are included in this directory. We can create
different users and can set permissions to them separately. Here we have ‘.xml’ and
‘csv’ files. In the csv files we can add the access right for the users. We can allow the
permission for read,write,create and unlink for each and every user. also possible to
set different rules for security in the ‘security.xml’ file.
 static: All web assets are included in the status directory. We have an src directory inside the
static directory. JS, CSS, SCSS, img, and many more are the different files for the web
interface, these are defined corresponding directories like JS, CSS, SCSS, img, and many
more under the src directory.
 In Odoo 15 the assets paths will be added on the __manifest__.py.
➢ tests: If the module needed any test cases, those test cases can be added at here
➢ views: Views directory contains XML files for views and templates. Views are the
visualization of records. We can define views for how to display the records for the end-user.
The developer can also do different customization in views. Here we can add ‘.xml’ file. There
are different view types in Odoo such as, tree, form, activity, kanban, and many more.
 wizard: Which contains the interactive section with dialogue boxes in odoo. And here it shows
the pop-up like in odoo UI. It also contain ‘__init__.py’ and ‘wizard.py’ file.
For More
Details
Check our company website for related blogs and Odoo
book.
Odoo Book V15
Check our YouTube channel for functional and technical
videos in Odoo.
Composition of Module in Odoo 15
Thank You

Odoo 15 Composition of Module

  • 1.
    Composition of Module inOdoo 15 www.cybrosys.com
  • 2.
    INTRODUCTION This slide describesthe various components of an odoo module. It discusses controllers, data, docs, translations, reports, security, static files and folders, unit tests, views, and wizards.
  • 3.
    ❖ An Odoomodule contains a number of elements, Each module build as a technical name, here it is named as ‘my_module’. When we open the ‘my_module’ directory in the pycharm we can see many more folders.
  • 4.
    ❖ Each modulecontains required python files, they are ‘__init__.py’ and ‘__manifest__.py’ file. ❖ __init__.py In the __init__.py file, we have to import all the python files that we are going to use. Suppose as described above we have a python file called model.py in our module. The first thing we have to do is, import the model.py in the __init__.py file.So our __init__.py file will be like this,
  • 5.
    ➢ __manifest__.py In the__manifest__.py, We have to mention the module name, the author name, version, description, company, category, etc. Now let us see what all these things for, * Name – Name of the module to be displayed. Version – version of the released module. * Summary – Summary for the module. * Category – Category of the module, whether it is sales, purchase, the point of sale etc.
  • 6.
    * depends –Suppose if our module depends on any other modules, we have to mention that name in the depends. As we are going to create a new module and as it is not depending on any other modules, just add depends as the base. * data – In the data section, we have to specify all the .xml files here. In our case, we have to mention the view.xml
  • 7.
    ❖ So our__manifest__.py file will be like this,
  • 8.
    , ❖ Then Let’sdiscuss about each components, ➢ Controllers : It is web controllers, which is used for the front-end and back-end of the action views. And it requests from the web browsers, Inside the controllers we can see the ‘__init__.py’ file and ‘controllers.py’ file. In the ‘__init__.py’ file it will load or import the ‘controllers.py’. And the ‘controllers.py’ file which render the request to show the website.
  • 9.
     demo :Here we have to add ‘demo.xml’ file, which are loaded in the demonstration mode. For eg, If we need to load a contact details while we installing the module those contact details can be added in the ‘demo.xml’ file. So, the ‘demo.xml’ file uploaded while we installing the module.
  • 10.
    ➢ doc: Herewe have to add like ‘.pdf’, ‘.txt’ file. Here we can update documents related to this module. ➢ i8n: This is for internationalization, it can be user to add translation to your modules. It consist of ‘.po’ file, For eg, If the user is using arabic language, he needs its fields, labels or things in arabic, we can load the fields name in arabic in the ‘.po’ files. And ‘po’ can be obtained by exporting the custom modules.
  • 11.
    joijjjjj ➢ models: Herewe can declared the business objects. It also contains an ‘__init__.py’ and ‘models.py’ file. ‘__init__.py’ file which loads the ‘models.py’ file. Here we can add more functionality and new features to our business.
  • 12.
    ➢ reports: Allthe files that relate to reports will be included in the report directory. We can create different reports in Odoo. A report contains 2 elements: ir.actions.report: which defines different parameters for the report. Qweb view: We can render the reports using different elements in qweb. The reports directory also contains a ‘__init__.py’ and python file named as ‘reports.py’ file. And the ‘__init__.py’ file also load the ‘reports.py’ file in the report.
  • 13.
     security: Allsecurity-related files are included in this directory. We can create different users and can set permissions to them separately. Here we have ‘.xml’ and ‘csv’ files. In the csv files we can add the access right for the users. We can allow the permission for read,write,create and unlink for each and every user. also possible to set different rules for security in the ‘security.xml’ file.
  • 14.
     static: Allweb assets are included in the status directory. We have an src directory inside the static directory. JS, CSS, SCSS, img, and many more are the different files for the web interface, these are defined corresponding directories like JS, CSS, SCSS, img, and many more under the src directory.
  • 15.
     In Odoo15 the assets paths will be added on the __manifest__.py.
  • 16.
    ➢ tests: Ifthe module needed any test cases, those test cases can be added at here ➢ views: Views directory contains XML files for views and templates. Views are the visualization of records. We can define views for how to display the records for the end-user. The developer can also do different customization in views. Here we can add ‘.xml’ file. There are different view types in Odoo such as, tree, form, activity, kanban, and many more.
  • 17.
     wizard: Whichcontains the interactive section with dialogue boxes in odoo. And here it shows the pop-up like in odoo UI. It also contain ‘__init__.py’ and ‘wizard.py’ file.
  • 18.
    For More Details Check ourcompany website for related blogs and Odoo book. Odoo Book V15 Check our YouTube channel for functional and technical videos in Odoo. Composition of Module in Odoo 15
  • 20.