Well-structured Odoo modules are easier to maintain, upgrade and publish. Here are the conventions we follow at Orvix Nexus for every custom module.
Module Structure
- Use a clear prefix (e.g.
onxs_) to avoid naming conflicts - Keep models, views, security and data in separate folders
- Declare all dependencies explicitly in
__manifest__.py - Include proper
static/description/assets for the Odoo Apps Store listing
Python Models
Extend existing models with _inherit rather than duplicating. Use computed fields with clear @api.depends. Avoid stored fields unless necessary for performance.
Frontend (OWL)
Odoo 17 POS and the backend use OWL components. Patch existing components with @web/core/utils/patch instead of overriding entire files. Register assets in the manifest under the correct bundle.
XML Templates
Inherit QWeb templates with t-inherit and xpath. Inherit from core templates (e.g. point_of_sale.Navbar) rather than intermediate module templates to avoid asset bundle ordering issues.
Testing & Publishing
Test on a clean Odoo 17 database with only required dependencies. Clear asset cache after JS/XML changes. Write an Odoo Apps Store-safe index.html using hex colors and Bootstrap classes.