odoo-development
Expert guidance for Odoo ERP development including Python ORM, XML views, and module architecture
Security Assessment
About odoo-development
Expert guidance for developing on the Odoo ERP platform, spanning the Python ORM, XML views, and module architecture for enterprise business applications. It emphasizes leveraging Odoo's ORM, API decorators, and XML view inheritance for modularity while following PEP 8 and Odoo conventions. Models inherit from models.Model and use decorators appropriately - @api.model for model-level methods, @api.multi for recordset methods, @api.depends for computed fields, @api.onchange for UI field changes, and @api.constrains for validation - with HTTP endpoints exposed through @http.route controllers. UI is built as XML views (forms, trees, kanban, calendar, graphs) and customized through inheritance via <xpath> and <field> rather than by modifying core code. Error handling relies on built-in exceptions like ValidationError and UserError, strategic try-except blocks, and Odoo's _logger, with tests written in Odoo's testing framework. Security is treated as a cross-cutting concern: ACLs and record rules defined in XML, permissions managed through security groups, and access rights declared in ir.model.access.csv. The guidance also covers internationalization with _() for translatable strings, automation through server actions and cron jobs, QWeb for dynamic HTML templating, and performance techniques such as domain-filtered queries, caching rarely-updated data, prefetch_fields, and offloading heavy work to scheduled actions. A recommended module layout separates models, views, controllers, data, security, static assets, wizards, and reports, alongside a documented __manifest__.py. Worked examples show a model definition with a Selection state field, a computed display name, and an @api.constrains check, plus a corresponding form view using a statusbar widget. The guiding conventions are convention over configuration, security at every layer, modular architecture, comprehensive documentation, and extending through inheritance rather than editing the core.
FAQ
Which API decorators does the guidance cover?
@api.model for model-level methods, @api.multi for recordset methods, @api.depends for computed fields, @api.onchange for UI field changes, and @api.constrains for validation.
How should access control be handled?
Define ACLs and record rules in XML, manage permissions through security groups, and set access rights in ir.model.access.csv files, enforcing security at every architectural layer.
What is the recommended way to customize existing Odoo behavior?
Extend via inheritance using XML <xpath> and <field> for view modifications and never modify core code, following the 'Convention Over Configuration' principle.
How are errors and validation managed?
Use built-in exceptions such as ValidationError and UserError, enforce constraints with @api.constrains, apply try-except blocks strategically, and log through Odoo's _logger.
What belongs in a well-organized module?
Separate directories for models, views, controllers, data, security, static assets, wizards, and reports, plus a documented __manifest__.py and the necessary __init__.py files.
Install odoo-development
Quick Setup:
- Copy the skill folder to
.claude/skills/ - Claude will automatically detect and use the skill
Repository
mindrally/skills