The open-source ERP framework Odoo 18 enables businesses to optimize their operations through the integration of sales and inventory management and accounting and CRM applications and additional features. Odoo gives developers access to a flexible architecture and extensive development tools which enable efficient creation of custom business applications. Learning to develop custom module in odoo 18 stands as a basic requirement for anyone who wants to become proficient in Odoo development regardless of their experience level. This guide provides a complete walkthrough of creating a module structure and writing Python and XML files before showing you how to install and test your module in a local Odoo 18 environment. The final result will enable you to create business applications that fulfill your particular requirements.
Step 1: Create the Module Folder
Go to your Odoo custom addons directory and create a new folder for your module:
cd ~/odoo18/custom_addons
mkdir my_custom_module
Step 2: Create the Basic Files
Inside your new module, you need to create the following files and folders:
my_custom_module/
├── __init__.py
├── __manifest__.py
├── models/
│ └── __init__.py
│ └── my_model.py
├── views/
│ └── my_model_views.xml
├── security/
│ └── ir.model.access.csv
File: __manifest__.py
{
'name': 'My Custom Module',
'version': '1.0',
'summary': 'Simple module to demonstrate Odoo development',
'author': 'Your Name',
'depends': ['base'],
'data': [
'security/ir.model.access.csv',
'views/my_model_views.xml',
],
'installable': True,
'application': True,
}
Step 3: Define Your Model
File: models/__init__.py
from . import my_model
file: models/my_model.py
from odoo import models, fields
class MyModel(models.Model):
_name = 'my.model'
_description = 'My Custom Model'
name = fields.Char(string='Name', required=True)
description = fields.Text(string='Description')
Step 4: Create Views for the Model
File: views/my_model_views.xml
my.model.form
my.model
my.model.list
my.model
My Models
my.model
list,form
Step 5: Set Up Access Rights
File: security/ir.model.access.csv
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
access_my_model_user,access_my_model_user,model_my_model,,1,1,1,1
Step 6: Initialize Your Module
File: __init__.py
from . import models
Step 7: Install the Module in Odoo
- Start your Odoo 18 server:
./odoo-bin -d your_database_name -u all
- Go to Apps in the Odoo UI.
- Click the Update Apps List (activate developer mode).
- Search for your module (e.g., “My Custom Module”).
- Click Install.
Result:
You should now see a new menu item in your Odoo backend called “My Module”, where you can create and view records using your custom model.
Building a Strong Foundation with Custom Module in odoo 18
Every developer working with Odoo 18 needs to learn how to create custom modules because this skill enables them to develop tailored solutions that match specific business needs through Odoo’s modular framework. The ability to design business-specific solutions emerges from Odoo’s modular structure through which you can extend its functionality. After learning about models, views, menus and access control you can begin developing adaptable applications that smoothly connect with other Odoo modules. The mastery of these fundamental concepts enables developers to access more complex features and extensive customization capabilities.



