As we all know Odoo is basically a web based open source platform which act as a solution for all business requirements and Odoo module is a set of business logic which helps to enhance the excessive functionality or to add some new functionality in order.
2. As we all know Odoo is basically a web based open source
platform which act as a solution for all business
requirements and Odoo module is a set of business logic
which helps to enhance the excessive functionality or to
add some new functionality in order.In this slide we can
check how to create a module “School Management” in
Odoo 16.
3. • First we need to create a custom directory [ here we named as custom addons].
• Inside this we can create the modules that we needed and then add its path along
with addons path in odoo.conf
• Then we create a module inside custom addons named school_management
which helps to create the records of student admission in a school.
• Inside the school_management create python file named __init__.py which is the
python module discriminator file where we can load the python packages that
needed for this module.
• Then we create another python file named __manifest__.py which is the metadata
of the module and this file helps to show the module name on the Odoo app list.
4. • Then create a directory named models which is used to create business objects.ie,we can
add new business objects or we can inherit current business objects that in the default
Odoo.
• In the model directory we are creating the python file __init__.py that is used to load the
python files that is used in the models.
• Next python file creating is school.py
• Here in this file , we will define the models and fields to store the data into the
database.So let our model be school.student,This will create a table in the database and
we have to define the fields to accept the values.
• To store values, we have to define different fields. There are different types of fields such
as char, int,many2one,one2many, date, etc. In the school management, we need a name,
class, division.
5.
6. • Next,we need to define the views so that it can be seen in the odoo users interface.For
that we can create a directory ‘views’.
• Inside the folder we create a file named school.xml file.Inside this file we can add
menuitem of the school ,Actions and views that we needed for the school management
module.
• Here we create Main menu as school_menu and the subsequent menu as school_exams
menu.Also defined its actions.
7.
8. • Next we define the basic view for that particular model.
9. • Now lets create a security file under the module.In the security folder we place all the files
related to the security.Here we have to create a csv file named ‘ir.model.access.csv’.
• At this file we can declare the access for each model for which of the users who have
permission to read , write or edit that particular object.
10. ● Next we can move to the Manifest file which is the metadata of the module and it has
some required fields as
○ Name - Name of the module.
○ Description - Brief description of the module.
○ Version- Here, we can specify the module version.
○ License - Specify the distribution license
○ Author - Author name of the module.
○ Website - Module author’s website URL.
○ Category - Specify the category name.
○ Depends - specify the list of modules that must installed before installing the module.
○ Data - With the installation of the module, these files are installed or updated.
○ Demo - In active demonstration mode, the data files that are installed or updated.
11.
12. Now you just restart your odoo service and activate the developer mode and click on the
Apps → Update Apps List → Update
13. Once you click on the update button ,search for our model that we have created and the click
on the install button.