Module Structure

When developing in Odoo, the structure of a module plays a vital role in ensuring consistency, maintainability, and scalability. In Odoo 18, the core structure of a module remains largely the same as in previous versions, but with continued emphasis on clean architecture and better separation of logic and data.

An Odoo module is essentially a self-contained package that includes everything needed to introduce new functionality — from business logic and views to security rules and static assets. At the heart of every module are two essential files:

  • __init__.py: This file turns the folder into a Python package and defines how Python files within the module are imported.
  • __manifest__.py: Known as the manifest file, it describes metadata about the module and defines how it interacts with the rest of the system.

Here’s a breakdown of the core elements that make up a typical Odoo 18 module:

odoo-development

__manifest__.py

This is the module descriptor file. It includes important details like:

  • name: The display name of the module.
  • version: The module’s version.
  • summary / description: A brief about what the module does.
  • author, website, company: Author and publisher information.
  • category: Defines where the module is listed in the apps menu.
  • license: Type of license (e.g., LGPL-3, OPL-1).
  • depends: A list of other modules required for this one to work.
  • data: Lists XML/CSV files to load on installation.
  • demo: Files used for demonstration or testing purposes.

models/

Contains all Python files that define your database models and business logic. You should import these files in the module’s __init__.py to make them available to Odoo.

views/

Houses all XML files that define user interface components such as forms, lists, kanban views, menus, and actions. These files are referenced in the manifest.

security/

This folder includes:

  • ir.model.access.csv: Defines access rights for each model.
  • Security rules (.xml): Define user groups and record rules.

data/

Includes essential data required for the module to function — like sequences, default records, or configuration settings.

demo/

Contains demo data, useful for testing, training, or showcasing the module. These are only loaded when demo mode is enabled.

i18n/

Handles translations. Files like .po and .pot are used to translate text in the module. Odoo reads these automatically; no need to add them in the manifest.

i18n/

Handles translations. Files like .po and .pot are used to translate text in the module. Odoo reads these automatically; no need to add them in the manifest.

controllers/

Defines website and API controllers. These Python files manage HTTP routes and web-based interactions — often used in website or portal modules.

static/

This folder contains all front-end assets: JavaScript files, CSS/SCSS stylesheets, fonts, and images. These resources are publicly accessible and are referenced in web templates.

wizard/

Contains transient models (temporary forms). Wizards guide users through multi-step operations and store data temporarily.

report/

Includes templates and XML definitions for generating reports like PDFs (e.g., invoices, quotations). You define report actions and templates here.

Understanding and following this structured approach ensures your modules are well-organized, reusable, and easier to maintain — whether you're building a simple utility or a large enterprise extension in Odoo 18.

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