odoo-code-review

- PEP8: Strictly follow PEP8 (120 chars line length is often acceptable in Odoo).

Safety Notice

This listing is imported from skills.sh public index metadata. Review upstream SKILL.md and repository scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "odoo-code-review" with this command: npx skills add nguyenhuy158/skills/nguyenhuy158-skills-odoo-code-review

Odoo Code Reviewer

Python Guidelines

General

  • PEP8: Strictly follow PEP8 (120 chars line length is often acceptable in Odoo).

  • Imports:

  • odoo imports first.

  • from odoo import models, fields, api, _

  • from odoo.exceptions import UserError, ValidationError

ORM Methods

  • Search: Use search_count() instead of len(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

  • Naming:

  • Fields: snake_case . Many2one fields usually end with _id (e.g., partner_id ).

  • One2many/Many2many: usually plural (e.g., line_ids , tag_ids ).

  • Computed Fields: Always add @api.depends .

  • Constrains: Use @api.constrains for data integrity checks.

  • Translations: Wrap user-facing strings in _() .

XML Guidelines

Views

  • Records: Use <record id="..." model="ir.ui.view"> .

  • Arch: All views must have an <arch type="xml"> block.

  • XPath: Use concise XPath expressions. Prefer name attributes over indices.

  • Bad: //field[3]

  • Good: //field[@name='description']

  • Attributes:

  • invisible : Use strictly for hiding.

  • readonly : For uneditable fields.

  • required : For mandatory fields.

  • Noids: Avoid hardcoded database IDs. Use ref="module.xml_id" .

Data Files

  • NoUpdate: Use noupdate="1" in <data> for data that shouldn't be reset on upgrade (like sequence numbers or cron jobs).

Manifest (manifest.py)

  • Ensure depends lists all required modules.

  • Ensure data lists all XML/CSV files in correct order (security -> views -> data).

  • Ensure license is specified (e.g., LGPL-3).

Review Checklist

  • Security: Are access rights (ir.model.access.csv) defined?

  • Performance: Are there loops doing SQL queries inside? (N+1 problem).

  • Upgrade: Will this code break on module update?

  • Idempotency: Can this XML be loaded multiple times without duplicating data?

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

General

copilot-commit-style

No summary provided by upstream source.

Repository SourceNeeds Review
Coding

Self Updater

⭐ OPEN SOURCE! GitHub: github.com/GhostDragon124/openclaw-self-updater ⭐ ONLY skill with Cron-aware + Idle detection! Auto-updates OpenClaw core & skills, an...

Registry SourceRecently Updated
1221Profile unavailable
Coding

ClawHub CLI Assistant

Use the ClawHub CLI to publish, inspect, version, update, sync, and troubleshoot OpenClaw skills from the terminal.

Registry SourceRecently Updated
1.9K2Profile unavailable
Coding

SkillTree Learning Progress Tracker

Track learning across topics like an RPG skill tree. Prerequisites, milestones, suggested next steps. Gamified learning path.

Registry SourceRecently Updated
900Profile unavailable