Home › Curriculum › Odoo Developer › Code quality: OCA guidelines, linting, reviews and documentation
Testing, quality and performance · 12 min · 17–20Code quality: OCA guidelines, linting, reviews and documentation
Conventions, pre-commit with pylint-odoo, reviewing code, writing READMEs, translations and licences.
In this lesson
- Conventions
- Automated linting
- Code review checklist and documentation
Key points
- Naming: files, XML IDs, _compute_/_check_/action_/_prepare_ methods
- pre-commit: pylint-odoo, ruff/flake8, prettier, OCA tools
- Review: requirement, tests, super(), sudo, security, upgrade-safety, performance, README
- Licences: LGPL-3, OEEL-1, OPL-1; respect third parties
Real-world example
Adopting pre-commit with pylint-odoo on a partner's 120-module repository surfaced 14 SQL-injection risks, 300 untranslated strings and 40 deprecated view attributes. Fixing them before the Odoo 20 upgrade cut migration time by a third.
Questions and answers
What should a module README cover?
Purpose, configuration, usage, known issues/limitations (and credits).
Name the method prefix for constraints.
_check_.