odoo-code-review
Installation
SKILL.md
Odoo Code Reviewer
Python Guidelines
General
- PEP8: Strictly follow PEP8 (120 chars line length is often acceptable in Odoo).
- Imports:
odooimports first.from odoo import models, fields, api, _from odoo.exceptions import UserError, ValidationError
ORM Methods
- Search: Use
search_count()instead oflen(search()). - Filtered: Use
filtered()for in-memory filtering of recordsets. - Mapped: Use
mapped()to extract values. - Write/Create: Batch operations where possible.
- SQL: Avoid direct SQL (
self.env.cr.execute) unless absolutely necessary for performance. If used, never inject variables directly; use parameters.