Skip to content
Odotify

Odoo modules: how to build and install a custom module

Odotify team · Published · 8 min read

How a custom Odoo module goes from code to production: scaffold, write the manifest and models, install, update and upgrade

Every feature in Odoo, from Sales to the smallest settings checkbox, is a module. Sooner or later most companies need one Odoo does not ship: a field that drives a calculation, a link to a carrier, a report only your industry needs. This guide is for business owners deciding where their modules can run and for developers starting their first one. You will learn what a module contains, where modules come from, how to write and install a minimal one on Odoo 20, and what it costs you at each upgrade. It is based on the Odoo 20.0 developer documentation (Server framework 101, module manifests, command line, upgrade scripts), the Odoo upgrade documentation and the Odoo 20.0 source code, all read on 30 November 2026.

What are Odoo modules?

A module is a directory that Odoo can load to add new business logic or to change existing logic. Odoo's documentation puts it simply: all apps are modules; larger standalone modules are called apps, and smaller ones serve as add-ons to them. Sales is an app; sale_stock, which links Sales and Inventory, is a module.

A module can contain:

PartWhat it is
__manifest__.pyThe module's name, version, dependencies and the data files to load
__init__.pyImports the Python code
models/Python classes; the ORM creates a database table for each model
views/XML files with forms, lists, actions and menus
security/Who can read, create, update and delete each model
data/, demo/Records loaded at install, and demo records loaded only in demo mode
static/JavaScript, CSS and images for the web client

Where do Odoo modules come from?

Four places: Odoo's own apps, the Odoo Apps Store, the Odoo Community Association (OCA), and modules written for you.

  • Odoo's apps ship with Odoo. Community includes the LGPL-licensed ones; Enterprise adds modules such as Studio, Helpdesk and Planning. The split is on Odoo Community vs Enterprise.
  • The Odoo Apps Store (apps.odoo.com) sells and lists third-party modules for each version.
  • The OCA publishes free, community-maintained modules on GitHub, organized in repositories by topic, with one branch per Odoo version.
  • Custom modules are written by your developer or partner for your processes.

Whatever the source, check two things before you rely on a module: that it exists for your exact Odoo version, and its licence. The manifest's license key defaults to LGPL-3; other values include AGPL-3, OEEL-1 (Odoo Enterprise Edition License) and OPL-1 (Odoo Proprietary License).

Where can you install a custom module?

On Odoo.sh or on your own server; not on Odoo Online. Odoo's documentation states that Odoo Online is incompatible with custom modules or modules from the Odoo Apps Store. On Odoo Online, the only way to customize is Studio, described in Odoo Studio.

HostingCustom modulesNotes
Odoo OnlineNoStudio only, on the Custom plan
Odoo.shYes, from GitHubEnterprise on the Custom plan
Your own server, CommunityYesNo licence fee
Your own server, EnterpriseYesEnterprise subscription on the Custom plan

If you have not chosen hosting yet, the trade-offs are on self-hosted Odoo and the Odoo.sh alternative page.

How do you build a custom Odoo module?

Start with a manifest and an empty __init__.py; that is enough for Odoo to list the module. The Server framework 101 tutorial says a module must contain at least those two files, and that name is the manifest's only required field. The odoo-bin scaffold command creates a skeleton for you:

./odoo-bin scaffold equipment_loan /opt/odoo/custom-addons/

A small module that tracks equipment lent to customers looks like this.

__manifest__.py

{
    "name": "Equipment Loans",
    "version": "20.0.1.0.0",
    "depends": ["base"],
    "data": [
        "security/ir.access.csv",
        "views/equipment_loan_views.xml",
    ],
    "application": True,
    "license": "LGPL-3",
}

depends lists the modules that must be installed first. Odoo installs them before yours and, like a Linux package manager, uninstalls yours if a dependency is removed. Data files load in the order listed, so a file must come after the files it refers to.

models/equipment_loan.py (imported from models/__init__.py, itself imported from the top __init__.py)

from odoo import fields, models


class EquipmentLoan(models.Model):
    _name = "equipment_loan"
    _description = "Equipment loan"

    name = fields.Char(required=True)
    partner_id = fields.Many2one("res.partner", string="Borrower")
    date_due = fields.Date()

The ORM creates a database table named after _name.

security/ir.access.csv

id,name,model_id,group_id/id,operation,domain
access_equipment_loan,equipment_loan user,equipment_loan,base.group_user,crud,

When no access rights are defined on a model, no user can access its data. In Odoo 20 the rights are records of ir.access, with an operation column (crud for create, read, update and delete, ru for read and update) and an optional domain. Odoo 19 and earlier used ir.model.access.csv with one column per permission; the Odoo 20.0 source uses ir.access.csv in its own modules (for example stock and base_automation). When you port a module to 20, convert this file.

views/equipment_loan_views.xml needs at least a window action and a menu so users can reach the model:

<odoo>
    <record id="equipment_loan_action" model="ir.actions.act_window">
        <field name="name">Equipment loans</field>
        <field name="res_model">equipment_loan</field>
        <field name="view_mode">list,form</field>
    </record>
    <menuitem id="equipment_loan_menu_root" name="Equipment">
        <menuitem id="equipment_loan_menu_action" action="equipment_loan_action"/>
    </menuitem>
</odoo>

Without view definitions, Odoo shows default list and form views. Real modules then add views, computed fields, constraints and tests, as the rest of the Server framework 101 tutorial shows.

How do you install a custom module?

Put the module in a folder on Odoo's addons path, refresh the apps list, and install it.

  1. Copy the module folder into a directory listed in --addons-path (or addons_path in the config file). The option takes a comma-separated list of directories.
  2. Restart Odoo so it sees the new code.
  3. Turn on developer mode, open Apps, click Update Apps List, remove the "Apps" filter if the module is not an app, and install it.

From the command line, -i equipment_loan -d mydb installs it before the server starts. After you change Python code or data files, update the module with -u equipment_loan -d mydb (or -u all), because data files are only loaded when a module is installed or updated. The --dev option (for example --dev xml,reload) reloads code and views while you develop; Odoo's documentation says not to use it in production.

On Docker, mount the module folder into the container's extra addons directory; our Odoo Docker guide shows the layout.

What do custom modules cost at upgrade time?

Each custom module must be ported to the new Odoo version before Odoo can upgrade your database. Odoo's upgrade documentation says a database with custom modules cannot be upgraded until a version of those modules exists for the target version, and recommends porting the code while Odoo prepares an upgraded test database. Odoo defines a custom module as any module that extends standard code and was not built with Studio; Studio customizations are upgraded by Odoo's service as long as Studio stays installed.

For changes to your own data between module versions, Odoo runs upgrade scripts: Python files in <module>/migrations/<version>/ (or upgrades/, the preferred name since Odoo 13) named pre-*.py, post-*.py or end-*.py, each with a migrate(cr, version) function. They run only when the module is updated and its new version is higher than the installed one.

Budget porting time per module for every major version. The Odoo upgrade guide covers the whole process, and a staging copy is where you test it.

Steps to ship a custom module safely

  1. Check that Odoo, the Apps Store or the OCA does not already cover the need for your version.
  2. Scaffold the module and set the manifest: version, dependencies, licence, data files in load order.
  3. Write the models, access rights (security/ir.access.csv on Odoo 20) and views.
  4. Keep the module in Git, one branch per Odoo version.
  5. Install it on a copy of production and test with real data and real users.
  6. Deploy to production, then update it with -u on every change.
  7. Before each major Odoo upgrade, port the module and add upgrade scripts for data changes.

Where Odotify fits

Odotify runs Odoo 17, 18, 19 or 20, Community or Enterprise, on servers you own at Hetzner, DigitalOcean, AWS, Google Cloud, Azure, Vultr, Akamai or any Linux host. You connect GitHub, GitLab or any Git host and deploy addons per branch, or upload a module as a zip; Odotify takes a backup first. On paid plans you test a module on a staging instance, then push staging to production, which ships code, addons and apps but never data. Plans are on the pricing page.

FAQ

What are Odoo modules?

Odoo modules are directories with a manifest and Python, XML and data files that add or change features in Odoo. Apps such as Sales or Inventory are larger modules; smaller modules extend them.

What is the difference between an Odoo app and a module?

Every app is a module. Odoo calls the larger standalone modules apps and the smaller ones, which add features to apps, modules. In the manifest, application set to True makes a module appear under the Apps filter.

Can I install custom modules on Odoo Online?

No. Odoo's documentation states that Odoo Online is incompatible with custom modules and Odoo Apps Store modules. Use Odoo.sh or your own server, or Studio for no-code changes.

Which files does an Odoo module need?

At least manifest.py and init.py. The manifest's only required field is name. Real modules add models, views and access rights, which are in security/ir.access.csv on Odoo 20.

How do I update a custom module in Odoo?

Restart Odoo with the new code and run it with -u followed by the module name and -d with the database. Data files are only reloaded on install or update.

Do custom modules break Odoo upgrades?

They block them until they are ported. Odoo cannot upgrade a database with custom modules until those modules exist for the target version, so plan porting work for every major upgrade.

Sources

Odotify team

Odotify hosts Odoo on servers its customers own. This article was researched against live search results and the Odotify codebase.

More articles

All articles

Run Odoo on your own server, without the server work.

Odotify installs, backs up, updates and watches Odoo on any Linux server you own. Free for one server.