odoo-code-review
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.
Fields & Models
More from nguyenhuy158/skills
copilot-commit-style
Use this skill when the user asks to write, generate, draft, or format a git commit message. It enforces the Conventional Commits specification with mandatory emojis and strict formatting rules.
9git-branch-clean
Use this skill when user wants to clean up local git branches whose remote tracking branches are gone/deleted. Triggers on phrases like "clean branches", "delete stale branches", "prune branches", "git branch clean", "dọn branch", "xóa branch cũ".
3pr-creator
Use this skill when user wants to create a pull request (PR) from current branch to another branch. Triggers on phrases like "create PR", "open PR", "make pull request", "tạo PR", "tạo pull request".
3code-polish
Polish Python code in git-changed files. Removes all comments and docstrings, eliminates magic strings and numbers, makes code self-documenting via naming. Python only — skips other languages. Use when user says "code-polish", "polish code", "clean code", "self-documenting", "remove comments", "làm sạch code".
2