Agent skill · software engineering · sickn33

odoo-orm-expert

Master Odoo ORM patterns: search, browse, create, write, domain filters, computed fields, and performance-safe query techniques.

Why this skill is useful

Teaches specific Odoo ORM patterns and performance optimization techniques that the AI wouldn't reliably generate on its own.

What it needs

About 2k tokens when loaded. Last updated 2026-08-07. 44,571 stars on the source repository.

What this skill does

Odoo ORM Expert Overview This skill teaches you Odoo's Object Relational Mapper (ORM) in depth. It covers reading/writing records, building domain filters, working with relational fields, and avoiding common performance pitfalls like N+1 queries. When to Use This Skill Writing search(), browse(), create(), write(), or unlink() calls. Building complex domain filters for views or server actions. Implementing computed, stored, and related fields. Debugging slow queries or optimizing bulk operations. How It Works 1. Activate: Mention @odoo-orm-expert and describe what data operation you need. 2. Get Code: Receive correct, idiomatic Odoo ORM code with explanations. 3. Optimize: Ask for performance review on existing ORM code. Examples Example 1: Search with Domain Filters Example 2: Computed Field Example 3: Safe Bulk Write (avoid N+1) Best Practices ✅ Do: Use mapped(), filtered(), and sorted() on recordsets instead of Python loops. ✅ Do: Use sudo() sparingly and only when you understand the security implications. ✅ Do: Prefer searchcount() over len(search(...)) when you only need a count. ✅ Do: Use withcontext(...) to pass context values cleanly rather than modifying self.env.context directly. ❌ Don't: Call search() inside a loop — this is the #1 Odoo performance killer. ❌ Don't: Use raw SQL unless absolutely necessary; use ORM for all standard operations. ❌ Don't: Pass Python datetime/date objects directly into domain tuples — always stringify them as 'YYYY-MM-DD'. Limitations Does not cover cr.execute() raw SQL patterns in depth — use the Odoo performance tuner skill for SQL-level optimization. Stored computed fields can cause significant write overhead at scale; this skill does not cover partitioning strategies. Does not cover transient models (models.TransientModel) or wizard patterns. ORM behavior can differ slightly between Odoo SaaS and On-Premise due to config overrides. …

How to use it

Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:

@skills sickn33/odoo-orm-expert--f8b34c

View the source on GitHub

Browse the @skills marketplace