
Getting Started with Odoo Module Development: Structure, Inheritance, and OWL
I recently started exploring Odoo module development, and along the way, I’ve learned some core concepts that every beginner should understand. In this post, I’ll walk through:
- •Odoo module folder structure
- •Inheritance in Odoo
- •Odoo’s built-in design system
- •Introduction to OWL (Odoo Web Library)
1. Odoo Module Folder Structure
When you create a custom module in Odoo, the folder structure is very important. It helps Odoo recognize and load your module properly.
Here’s a typical structure:
my_module/
│
├── __init__.py
├── __manifest__.py
│
├── models/
│ ├── __init__.py
│ └── my_model.py
│
├── views/
│ └── my_views.xml
│
├── security/
│ └── ir.model.access.csv
│
├── data/
│ └── data.xml
│
├── static/
│ └── src/
│ ├── js/
│ ├── css/
│ └── xml/
│
└── controllers/
└── main.py
Key Files Explained
- •
__manifest__.py→ Defines module metadata (name, dependencies, data files) - •
models/→ Python files where business logic is written - •
views/→ XML files for UI (forms, lists, menus) - •
security/→ Access control rules - •
static/→ Frontend assets (JS, CSS, OWL components)
2. Inheritance in Odoo
Inheritance is one of the most powerful features in Odoo. It allows you to extend or modify existing functionality without changing core code.
Model Inheritance (Python)
from odoo import models, fields
class ResPartner(models.Model):
_inherit = 'res.partner'
custom_field = fields.Char(string="Custom Field")
This adds a new field to the existing res.partner model.
---
View Inheritance (XML)
<record id="view_partner_form_inherit" model="ir.ui.view">
<field name="name">res.partner.form.inherit</field>
<field name="model">res.partner</field>
<field name="inherit_id" ref="base.view_partner_form"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='name']" position="after">
<field name="custom_field"/>
</xpath>
</field>
</record>
This inserts a new field into an existing form view.
---
Why Inheritance Matters
- •Keeps core Odoo untouched
- •Makes upgrades easier
- •Encourages modular development
3. Odoo’s Built-in Design System
One of the things I found impressive is that Odoo already provides a polished UI and UX.
What Odoo Handles for You
- •Responsive layout
- •Predefined form and list views
- •Widgets such as date picker, kanban, and status bars
- •Styling via a Bootstrap-based system
---
Example: Simple Form View
<form string="My Model">
<sheet>
<group>
<field name="name"/>
<field name="custom_field"/>
</group>
</sheet>
</form>
Even with minimal XML, Odoo renders a clean UI automatically.
---
4. Introduction to OWL (Odoo Web Library)
Modern versions of Odoo use OWL, a frontend framework similar to React.
What is OWL?
- •Component-based JavaScript framework
- •Used to build dynamic UI in Odoo
- •Powers the web client interface
Basic OWL Component Example
/ @odoo-module /
import { Component } from "@odoo/owl";
export class MyComponent extends Component {
static template = "my_module.MyComponent";
}
<t t-name="my_module.MyComponent">
<div>Hello from OWL!</div>
</t>
---
Why OWL is Important
- •Enables dynamic, reactive UI
- •Replaces older JavaScript approaches in Odoo
- •Essential for advanced frontend customization
Final Thoughts
Starting with Odoo module development can feel overwhelming at first, but once you understand:
- •Folder structure
- •Inheritance
- •Built-in UI system
- •OWL basics
---
What I Learned So Far
- •Odoo is highly modular and extensible
- •You rarely need to modify core code
- •Backend (Python) and frontend (OWL) together make it a full-stack framework