mirror of
https://github.com/unclecatvn/agent-skills.git
synced 2026-09-14 20:53:17 +08:00
Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| ced908feaf | |||
| fbd7439b46 |
@@ -66,6 +66,10 @@ Specialized agents that act as senior technical leads:
|
||||
| Agent | What it does |
|
||||
|-------|--------------|
|
||||
| **[Odoo Code Review](agents/odoo-code-review/SKILL.md)** | Automatically reviews Odoo code with scoring (1-10) and detailed feedback |
|
||||
| **[Odoo Code Tracer](agents/odoo-code-tracer/SKILL.md)** | Traces execution flow from entry point to end, identifying all function calls |
|
||||
| **[Odoo Module Generator](agents/odoo-module-generator/SKILL.md)** | Scaffolds complete Odoo 18 modules with proper structure |
|
||||
| **[Odoo Query Optimizer](agents/odoo-query-optimizer/SKILL.md)** | Diagnoses N+1 queries and provides optimization suggestions |
|
||||
| **[Odoo Migration Helper](agents/odoo-migration-helper/SKILL.md)** | Converts Odoo 16/17 code to Odoo 18 (tree→list, unlink→ondelete, etc.) |
|
||||
| **[Planner](agents/planner.md)** | Breaks down complex features into actionable implementation steps |
|
||||
|
||||
### Rules - Coding Standards
|
||||
@@ -136,7 +140,7 @@ graph LR
|
||||
|--------|-------|
|
||||
| Documentation | 10,000+ lines |
|
||||
| Skill Packs | 8 (Odoo 18.0, 19.0, DTG Base, Payment, Code Review, Brainstorming, Writing, MCP) |
|
||||
| Agents | Code Reviewer, Planner |
|
||||
| Agents | 6 (Code Review, Tracer, Module Generator, Query Optimizer, Migration Helper, Planner) |
|
||||
| License | MIT |
|
||||
|
||||
---
|
||||
|
||||
@@ -5,6 +5,29 @@ globs: "**/*.{py,xml}"
|
||||
license: MIT
|
||||
author: UncleCat
|
||||
version: 1.0.0
|
||||
topics:
|
||||
- Actions (ir.actions.*, cron, bindings)
|
||||
- Controllers (HTTP, routing, web endpoints)
|
||||
- Data files (XML/CSV, records, shortcuts)
|
||||
- Decorators (@api.depends, @api.constrains, @api.ondelete)
|
||||
- Development (modules, manifest, wizards, reports)
|
||||
- Field types (Char, Text, Monetary, relational fields)
|
||||
- Manifest (__manifest__.py configuration)
|
||||
- Mixins (mail.thread, activities, aliases, tracking)
|
||||
- Model methods (ORM, CRUD, search, domain)
|
||||
- Migration (upgrading modules, data migration)
|
||||
- OWL components (hooks, services, UI)
|
||||
- Performance (N+1 prevention, optimization)
|
||||
- Reports (QWeb, PDF/HTML, templates)
|
||||
- Security (ACL, record rules, field permissions)
|
||||
- Testing (unit tests, browser tests, mocking)
|
||||
- Transactions (savepoints, errors, serialization)
|
||||
- Translation (i18n, localization, PO files)
|
||||
- Views & XML (list, form, search, QWeb)
|
||||
when_to_use:
|
||||
- Finding the appropriate guide for an Odoo 18 task
|
||||
- Understanding module structure and conventions
|
||||
- Looking up best practices for specific Odoo features
|
||||
---
|
||||
|
||||
# Odoo 18 Skill - Master Index
|
||||
@@ -308,6 +331,11 @@ All guides are based on analysis of Odoo 18 source code:
|
||||
- `odoo/addons/base/models/res_lang.py` - Language model
|
||||
- `addons/web/static/src/core/l10n/translation.js` - JS translations
|
||||
|
||||
## External Documentation
|
||||
|
||||
- [Odoo 18 Official Documentation](https://github.com/odoo/documentation/tree/18.0) - Official Odoo 18 documentation on GitHub
|
||||
- [Odoo 18 Developer Reference](https://github.com/odoo/documentation/blob/18.0/developer/reference/orm.rst) - ORM API reference
|
||||
|
||||
---
|
||||
|
||||
**For setup instructions with different AI IDEs, see [AGENTS.md](./AGENTS.md)**
|
||||
|
||||
@@ -4,7 +4,8 @@ description: Complete reference for Odoo 18 ORM model methods, CRUD operations,
|
||||
globs: "**/models/**/*.py"
|
||||
topics:
|
||||
- Recordset basics (browse, exists, empty)
|
||||
- Search methods (search, search_read, search_count, read_group)
|
||||
- Search methods (search, search_read, search_count)
|
||||
- Aggregation methods (_read_group core, read_group for UI)
|
||||
- CRUD operations (create, read, write, unlink)
|
||||
- Domain syntax (operators, logical, relational)
|
||||
- Environment context (with_context, with_user, with_company)
|
||||
@@ -13,6 +14,7 @@ when_to_use:
|
||||
- Writing ORM queries
|
||||
- Performing CRUD operations
|
||||
- Building domain filters
|
||||
- Using _read_group() for aggregations
|
||||
- Iterating over recordsets
|
||||
- Using environment context
|
||||
---
|
||||
@@ -274,34 +276,68 @@ result = self.read_group(
|
||||
# ]
|
||||
```
|
||||
|
||||
### _read_group() - Low-Level Internal Method (Odoo 18)
|
||||
### _read_group() - Core Aggregation Method (Odoo 18)
|
||||
|
||||
**IMPORTANT**: `_read_group()` is a **low-level internal method** used by the ORM. It returns raw tuples without `__domain`, `__context`, or `__range` metadata. Prefer using `read_group()` for typical use cases.
|
||||
**`_read_group()`** is the **core aggregation method** that `read_group()` calls internally (see `odoo/models.py:2888`). It returns tuples with proper recordsets for relational fields.
|
||||
|
||||
```python
|
||||
# Internal use only - returns list of tuples
|
||||
rows = self._read_group(
|
||||
# GOOD: _read_group() - simpler API, returns tuples
|
||||
for category, amount_total, count in self._read_group(
|
||||
domain=[('state', '=', 'draft')],
|
||||
groupby=['category_id'],
|
||||
aggregates=['amount_total:sum', '__count'],
|
||||
order='category_id'
|
||||
):
|
||||
# category: recordset (Many2one field)
|
||||
# amount_total: float
|
||||
# count: int
|
||||
print(f"{category.name}: {amount_total} ({count} orders)")
|
||||
|
||||
# Convert to dict for O(1) lookup (pattern from Odoo base)
|
||||
category_amounts = dict(self._read_group(
|
||||
domain=[('state', '=', 'draft')],
|
||||
groupby=['category_id'],
|
||||
aggregates=['amount_total:sum'],
|
||||
order='category_id'
|
||||
)
|
||||
# Result: [(1, 1500.0), (2, 2000.0), ...] - raw tuples
|
||||
))
|
||||
# Result: {category_recordset: amount_total, ...}
|
||||
```
|
||||
|
||||
**When to use `_read_group`**: Rarely, only for low-level custom SQL aggregation where you don't need the extra metadata that `read_group()` provides.
|
||||
|
||||
### read_group() vs _read_group()
|
||||
|
||||
| Method | Return Type | Has lazy | Has __domain | When to Use |
|
||||
|--------|-------------|---------|--------------|-------------|
|
||||
| `read_group()` | List of dicts | Yes | Yes | Most cases - calling aggregation from other models |
|
||||
| `_read_group()` | List of tuples | No | No | Low-level internal use only |
|
||||
| Method | Return Type | API Parameters | Has lazy | Has __domain | When to Use |
|
||||
|--------|-------------|----------------|---------|--------------|-------------|
|
||||
| `_read_group()` | List of tuples | `domain, groupby, aggregates` | No | No | Data processing, aggregations (most cases) |
|
||||
| `read_group()` | List of dicts | `domain, fields, groupby` | Yes | Yes | UI components, reports with drill-down |
|
||||
|
||||
**For extending aggregation behavior**, use these helper methods instead:
|
||||
**Key Insight**: `_read_group()` is the **core method** called by `read_group()` internally. Both return proper recordsets for relational fields (via `_read_group_postprocess_groupby`).
|
||||
|
||||
```python
|
||||
# _read_group() - Core method with simpler API
|
||||
for partner, total, count in self._read_group(
|
||||
domain=[('state', '=', 'done')],
|
||||
groupby=['partner_id'],
|
||||
aggregates=['amount_total:sum', '__count'],
|
||||
):
|
||||
print(f"{partner.name}: {total} ({count} orders)")
|
||||
|
||||
# read_group() - Public API with metadata for UI
|
||||
data = self.read_group(
|
||||
domain=[('state', '=', 'done')],
|
||||
fields=['amount_total'],
|
||||
groupby=['partner_id'],
|
||||
lazy=True,
|
||||
)
|
||||
# Can use __domain for drill-down:
|
||||
for group in data:
|
||||
orders = self.search(group['__domain'])
|
||||
```
|
||||
|
||||
**For extending aggregation behavior**, use these helper methods:
|
||||
- `_read_group_expand_states()` - Expand selection groups
|
||||
- `_read_group_select()` - Custom aggregate SQL
|
||||
- `_read_group_groupby()` - Custom groupby SQL
|
||||
- `_read_group_fill_results()` - Fill empty groups
|
||||
- `_read_group_format_result()` - Format results with domain
|
||||
|
||||
### group_expand Parameter (Odoo 18)
|
||||
|
||||
|
||||
@@ -7,6 +7,7 @@ topics:
|
||||
- N+1 query prevention patterns
|
||||
- Batch operations (create, write, unlink)
|
||||
- Field selection optimization (search_read, load, bin_size)
|
||||
- Aggregation optimization (_read_group core method, read_group for UI)
|
||||
- Compute field optimization (store, precompute, avoiding recursion)
|
||||
- SQL optimization (when to use, execute_query, SQL class)
|
||||
- Clean code patterns (mapped, filtered, sorted)
|
||||
@@ -15,6 +16,7 @@ when_to_use:
|
||||
- Preventing N+1 queries
|
||||
- Writing batch operations
|
||||
- Optimizing computed fields
|
||||
- Using _read_group() for aggregations
|
||||
- Using direct SQL for aggregations
|
||||
---
|
||||
|
||||
@@ -217,6 +219,100 @@ records = self.search([('state', '=', 'done')])
|
||||
data = records.read(['name', 'amount_total', 'date'])
|
||||
```
|
||||
|
||||
### Use _read_group() for Aggregations
|
||||
|
||||
**`_read_group()`** is the core aggregation method that `read_group()` calls internally. It returns raw tuples with proper recordsets for relational fields.
|
||||
|
||||
```python
|
||||
# GOOD: _read_group() returns tuples: [(groupby_value, aggregate1, aggregate2, ...), ...]
|
||||
for partner_id, amount_total, count in self._read_group(
|
||||
domain=[('state', '=', 'done')],
|
||||
groupby=['partner_id'],
|
||||
aggregates=['amount_total:sum', 'id:count'],
|
||||
):
|
||||
# partner_id: recordset (Many2one field)
|
||||
# amount_total: float
|
||||
# count: int
|
||||
print(f"{partner_id.name}: {amount_total} ({count} orders)")
|
||||
```
|
||||
|
||||
#### Converting to Dictionary for Efficient Lookup
|
||||
|
||||
```python
|
||||
# GOOD: Convert _read_group result to dict for O(1) lookup
|
||||
# From Odoo base: account_move_line.py
|
||||
matching2lines = dict(self._read_group(
|
||||
domain=[('matching_number', 'in', matching_numbers)],
|
||||
groupby=['matching_number'],
|
||||
aggregates=['id:recordset'],
|
||||
))
|
||||
# Result: {matching_number: lines_recordset, ...}
|
||||
```
|
||||
|
||||
#### Multiple Groupby Fields
|
||||
|
||||
```python
|
||||
# GOOD: Multiple groupby fields
|
||||
for matching_number, account, lines in self._read_group(
|
||||
domain=[('matching_number', 'in', temp_numbers)],
|
||||
groupby=['matching_number', 'account_id'],
|
||||
aggregates=['id:recordset'],
|
||||
):
|
||||
# matching_number: string
|
||||
# account: account.account recordset
|
||||
# lines: account.move.line recordset
|
||||
if all(move.state == 'posted' for move in lines.move_id):
|
||||
# Process grouped lines
|
||||
pass
|
||||
```
|
||||
|
||||
#### read_group() vs _read_group()
|
||||
|
||||
| Feature | `_read_group()` | `read_group()` |
|
||||
|---------|-----------------|----------------|
|
||||
| Return type | List of tuples | List of dicts |
|
||||
| API style | `domain, groupby, aggregates` | `domain, fields, groupby` |
|
||||
| Metadata | ❌ No `__domain`, `__context` | ✅ Includes metadata |
|
||||
| Lazy grouping | ❌ Not supported | ✅ Supported |
|
||||
| Empty group fill | ❌ Not supported | ✅ Supported |
|
||||
| Recordsets | ✅ Proper browse records | ✅ Proper browse records |
|
||||
| Used internally | ✅ Core method | Wrapper that calls `_read_group()` |
|
||||
| Use case | Data processing, internal logic | UI components, reports |
|
||||
|
||||
**Key Insight**: `_read_group()` is the **core method** that `read_group()` calls internally (see `odoo/models.py:2888`). Both return proper recordsets for relational fields.
|
||||
|
||||
```python
|
||||
# _read_group() - Core method, simpler API
|
||||
# Returns: [(groupby_val1, agg1, agg2), (groupby_val2, agg1, agg2), ...]
|
||||
data = self._read_group(
|
||||
domain=[('state', '=', 'done')],
|
||||
groupby=['partner_id'],
|
||||
aggregates=['amount_total:sum', '__count'],
|
||||
)
|
||||
|
||||
# read_group() - Public API with metadata
|
||||
# Returns: [{'partner_id': (1, 'Name'), 'amount_total': 100, '__domain': [...}, ...]
|
||||
data = self.read_group(
|
||||
domain=[('state', '=', 'done')],
|
||||
fields=['amount_total'],
|
||||
groupby=['partner_id'],
|
||||
lazy=True,
|
||||
)
|
||||
```
|
||||
|
||||
**When to use `_read_group()`** (recommended for most cases):
|
||||
- Data processing and aggregation
|
||||
- Building internal data structures
|
||||
- When you don't need `__domain` metadata
|
||||
- When you want tuple unpacking for cleaner code
|
||||
- **Used extensively in Odoo base code** (400+ files)
|
||||
|
||||
**When to use `read_group()`**:
|
||||
- UI components that need `__domain` for drill-down
|
||||
- Reports with lazy grouping
|
||||
- When you need empty group filling
|
||||
- Pivot graphs, kanban views
|
||||
|
||||
### Load Parameter for Read
|
||||
|
||||
```python
|
||||
@@ -456,11 +552,11 @@ orders.with_context(tracking_disable=True).write({'state': 'done'})
|
||||
- [ ] Avoid `search()` inside loops
|
||||
- [ ] Use `mapped()` instead of list comprehension for field access
|
||||
- [ ] Use `search_read()` when you need dicts, not recordsets
|
||||
- [ ] Use `_read_group()` for aggregations (core method; use `read_group()` only when you need `__domain` metadata or lazy grouping for UI)
|
||||
- [ ] Store expensive computed fields
|
||||
- [ ] Add all dependencies to `@api.depends`
|
||||
- [ ] Use `with_context(bin_size=True)` for binary fields
|
||||
- [ ] Use `with_context(active_test=False)` when including archived
|
||||
- [ ] Use `read_group()` for aggregations (prefer over `_read_group()` - it has lazy grouping and metadata)
|
||||
- [ ] Batch create/write/unlink operations
|
||||
- [ ] Add indexes on frequently searched fields
|
||||
- [ ] Use `filtered()` before operations
|
||||
|
||||
+144
-174
@@ -1,211 +1,181 @@
|
||||
# AI Agents Setup for Odoo 19 Skills
|
||||
# Odoo 19 Documentation - AI Agents Setup
|
||||
|
||||
This document provides instructions for setting up Odoo 19 skills with various AI IDEs.
|
||||
Setup guide for using Odoo 19 documentation with AI coding assistants (Cursor, Claude Code, OpenCode, etc.).
|
||||
|
||||
## Claude Code (Cursor/Windsurf)
|
||||
## Quick Start
|
||||
|
||||
### Step 1: Configure Settings
|
||||
### Remote Repository (Recommended)
|
||||
|
||||
Create or edit `~/.claude/settings.json`:
|
||||
**Cursor IDE** - Configure once:
|
||||
- `Settings` → `Rules` → `Add Remote Rule`
|
||||
- Source: `Git Repository`
|
||||
- URL: `git@github.com:unclecatvn/agent-skills.git`
|
||||
- Branch: `odoo/19.0`
|
||||
- Subfolder: `agent-skills/skills/odoo/19.0/`
|
||||
|
||||
```json
|
||||
{
|
||||
"documentation": [
|
||||
"/Users/unclecat/dtg/odoo-skills-19/skills/odoo/19.0/SKILL.md"
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
### Step 2: (Optional) Configure Context Rules
|
||||
|
||||
Create `~/.claude/rules/coding-style.md`:
|
||||
|
||||
```markdown
|
||||
# Odoo 19 Coding Style
|
||||
|
||||
Follow Odoo 19 development guidelines from the skills.
|
||||
|
||||
## Python
|
||||
|
||||
- Use `@api.depends` for computed fields
|
||||
- Use `@api.constrains` for validation
|
||||
- Use `@api.ondelete` for delete validation (Odoo 19)
|
||||
- Use `<list>` not `<tree>` in views
|
||||
- Use direct attributes not `attrs`
|
||||
|
||||
## XML
|
||||
|
||||
- Use `<list>` for list views
|
||||
- Use `invisible=""` not `attrs="{'invisible': [...]}"`
|
||||
|
||||
## JavaScript
|
||||
|
||||
- Use `_t()` for translations
|
||||
- Use OWL hooks properly
|
||||
```
|
||||
|
||||
### Step 3: Verify Installation
|
||||
|
||||
In Claude Code terminal:
|
||||
### Local Copy
|
||||
|
||||
```bash
|
||||
# Test skill loading
|
||||
python -c "import sys; print('Claude Code ready')"
|
||||
# Clone repository
|
||||
git clone git@github.com:unclecatvn/agent-skills.git
|
||||
|
||||
# Copy to your project
|
||||
cp -r agent-skills/skills/odoo/19.0 /your-project/agent-skills/skills/odoo/
|
||||
|
||||
# For Claude Code, create symlink
|
||||
ln -s agent-skills/skills/odoo/19.0/CLAUDE.md ./CLAUDE.md
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Continue.dev
|
||||
## Documentation Structure
|
||||
|
||||
### Step 1: Create Continue Config
|
||||
|
||||
Create `.continuerc.yaml`:
|
||||
|
||||
```yaml
|
||||
rules:
|
||||
- path: skills/odoo/19.0/SKILL.md
|
||||
type: documentation
|
||||
```
|
||||
|
||||
### Step 2: Configure in Continue UI
|
||||
|
||||
1. Open Continue
|
||||
2. Go to Settings → Config
|
||||
3. Add documentation path
|
||||
4. Save and reload
|
||||
agent-skills/skills/odoo/19.0/
|
||||
├── SKILL.md # Master index (all agents)
|
||||
├── dev/ # Development guides folder (19 files)
|
||||
│ ├── odoo-19-actions-guide.md # ir.actions.*, cron, bindings
|
||||
│ ├── odoo-19-controller-guide.md # HTTP, routing, controllers
|
||||
│ ├── odoo-19-data-guide.md # XML/CSV data files, records
|
||||
│ ├── odoo-19-decorator-guide.md # @api decorators
|
||||
│ ├── odoo-19-development-guide.md # Manifest, wizards (overview)
|
||||
│ ├── odoo-19-field-guide.md # Field types, parameters
|
||||
│ ├── odoo-19-manifest-guide.md # __manifest__.py reference
|
||||
│ ├── odoo-19-mixins-guide.md # mail.thread, activities, etc.
|
||||
│ ├── odoo-19-model-guide.md # ORM, CRUD, search, domain
|
||||
│ ├── odoo-19-migration-guide.md # Migration scripts, hooks
|
||||
│ ├── odoo-19-owl-guide.md # OWL components, services
|
||||
│ ├── odoo-19-performance-guide.md # N+1 prevention, optimization
|
||||
│ ├── odoo-19-reports-guide.md # QWeb reports, PDF/HTML
|
||||
│ ├── odoo-19-security-guide.md # ACL, record rules, security
|
||||
│ ├── odoo-19-testing-guide.md # Test classes, decorators
|
||||
│ ├── odoo-19-transaction-guide.md # Savepoints, errors
|
||||
│ ├── odoo-19-translation-guide.md # Translations, i18n
|
||||
│ └── odoo-19-view-guide.md # XML views, QWeb
|
||||
├── CLAUDE.md # Claude Code specific
|
||||
└── AGENTS.md # THIS FILE - setup guide
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Aider
|
||||
## Guide Reference
|
||||
|
||||
### Step 1: Add to .aider.conf
|
||||
| File | Purpose | When to Use |
|
||||
|------|---------|-------------|
|
||||
| `SKILL.md` | Master index for all guides | Find the right guide for your task |
|
||||
| `dev/odoo-19-actions-guide.md` | Actions (window, URL, server, cron) | Creating actions, menus, scheduled jobs |
|
||||
| `dev/odoo-19-controller-guide.md` | HTTP controllers, routing | Writing endpoints |
|
||||
| `dev/odoo-19-data-guide.md` | XML/CSV data files, records | Creating data files |
|
||||
| `dev/odoo-19-decorator-guide.md` | @api decorators usage | Using @api decorators |
|
||||
| `dev/odoo-19-development-guide.md` | Module structure, wizards | Creating new modules |
|
||||
| `dev/odoo-19-field-guide.md` | Field types, parameters | Defining model fields |
|
||||
| `dev/odoo-19-manifest-guide.md` | __manifest__.py reference | Configuring module manifest |
|
||||
| `dev/odoo-19-mixins-guide.md` | mail.thread, activities, mixins | Adding messaging, activities |
|
||||
| `dev/odoo-19-model-guide.md` | ORM methods, CRUD, domains | Writing model methods |
|
||||
| `dev/odoo-19-migration-guide.md` | Migration scripts, hooks | Upgrading modules |
|
||||
| `dev/odoo-19-owl-guide.md` | OWL components, hooks, services | Building OWL UI |
|
||||
| `dev/odoo-19-performance-guide.md` | Performance optimization | Fixing slow code |
|
||||
| `dev/odoo-19-reports-guide.md` | QWeb reports, templates | Creating reports |
|
||||
| `dev/odoo-19-security-guide.md` | ACL, record rules, security | Configuring security |
|
||||
| `dev/odoo-19-testing-guide.md` | Test classes, decorators, mocking | Writing tests |
|
||||
| `dev/odoo-19-transaction-guide.md` | Database transactions, error handling | Savepoints, UniqueViolation |
|
||||
| `dev/odoo-19-translation-guide.md` | Translations, localization, i18n | Adding translations |
|
||||
| `dev/odoo-19-view-guide.md` | XML views, actions, menus | Writing view XML |
|
||||
|
||||
```
|
||||
# Add Odoo 19 skills
|
||||
--add-skills-file
|
||||
/Users/unclecat/dtg/odoo-skills-19/skills/odoo/19.0/SKILL.md
|
||||
```
|
||||
---
|
||||
|
||||
### Step 2: Reload Aider
|
||||
## AI Agent Configuration
|
||||
|
||||
### Cursor IDE
|
||||
|
||||
| Setting | Value |
|
||||
|---------|-------|
|
||||
| Source | Git Repository |
|
||||
| URL | `git@github.com:unclecatvn/agent-skills.git` |
|
||||
| Branch | `odoo/19.0` |
|
||||
| Subfolder | `agent-skills/skills/odoo/19.0/` |
|
||||
|
||||
**Globs patterns used by Cursor:**
|
||||
|
||||
| File | globs Pattern |
|
||||
|------|---------------|
|
||||
| `SKILL.md` | `**/*.{py,xml}` |
|
||||
| `dev/odoo-19-actions-guide.md` | `**/*.{py,xml}` |
|
||||
| `dev/odoo-19-controller-guide.md` | `**/controllers/**/*.py` |
|
||||
| `dev/odoo-19-data-guide.md` | `**/*.{xml,csv}` |
|
||||
| `dev/odoo-19-decorator-guide.md` | `**/models/**/*.py` |
|
||||
| `dev/odoo-19-development-guide.md` | `**/*.{py,xml,csv}` |
|
||||
| `dev/odoo-19-field-guide.md` | `**/models/**/*.py` |
|
||||
| `dev/odoo-19-manifest-guide.md` | `**/__manifest__.py` |
|
||||
| `dev/odoo-19-mixins-guide.md` | `**/models/**/*.py` |
|
||||
| `dev/odoo-19-model-guide.md` | `**/models/**/*.py` |
|
||||
| `dev/odoo-19-migration-guide.md` | `**/migrations/**/*.py` |
|
||||
| `dev/odoo-19-owl-guide.md` | `static/src/**/*.{js,xml}` |
|
||||
| `dev/odoo-19-performance-guide.md` | `**/*.{py,xml}` |
|
||||
| `dev/odoo-19-reports-guide.md` | `**/report/**/*.xml` |
|
||||
| `dev/odoo-19-security-guide.md` | `**/security/**/*.{csv,xml}` |
|
||||
| `dev/odoo-19-testing-guide.md` | `**/tests/**/*.py` |
|
||||
| `dev/odoo-19-transaction-guide.md` | `**/models/**/*.py` |
|
||||
| `dev/odoo-19-translation-guide.md` | `**/*.{py,js,xml}` |
|
||||
| `dev/odoo-19-view-guide.md` | `**/views/**/*.xml` |
|
||||
|
||||
### Claude Code
|
||||
|
||||
```bash
|
||||
aider --reload
|
||||
# Place CLAUDE.md in project root
|
||||
ln -s agent-skills/skills/odoo/19.0/CLAUDE.md ./CLAUDE.md
|
||||
```
|
||||
|
||||
Claude Code reads:
|
||||
- `CLAUDE.md` - Project overview and quick reference
|
||||
- `SKILL.md` - Master index for all guides
|
||||
- Individual guides in `dev/` - Detailed information
|
||||
|
||||
### OpenCode
|
||||
|
||||
Copy documentation to project - no additional configuration needed.
|
||||
|
||||
### Other Agents
|
||||
|
||||
| Agent | Setup |
|
||||
|-------|-------|
|
||||
| Windsurf | Same as Cursor (uses `.mdc` files) |
|
||||
| Continue | Place `CLAUDE.md` or `dev/SKILL.md` in root |
|
||||
| Aider | Place `CLAUDE.md` or add to prompt |
|
||||
|
||||
---
|
||||
|
||||
## Cursor (with Cline)
|
||||
## Cursor / Claude Skills Folder
|
||||
|
||||
### Step 1: Add to .cursorrules
|
||||
For Cursor IDE with local rules, create:
|
||||
|
||||
```
|
||||
# Always reference Odoo 19 skills for Odoo development
|
||||
When working with Odoo 19 code, always reference the Odoo 19 skills in /Users/unclecat/dtg/odoo-skills-19/skills/odoo/19.0/
|
||||
.cursor/skills/
|
||||
└── odoo-19/
|
||||
└── SKILL.md -> ../../agent-skills/skills/odoo/19.0/SKILL.md
|
||||
```
|
||||
|
||||
### Step 2: Configure .cursorrules
|
||||
Or for Claude Code:
|
||||
|
||||
Create `.cursorrules` in your project root:
|
||||
|
||||
```markdown
|
||||
# Odoo 19 Development
|
||||
|
||||
For Odoo 19 development tasks, reference the skills at:
|
||||
- /Users/unclecat/dtg/odoo-skills-19/skills/odoo/19.0/SKILL.md
|
||||
|
||||
Key Odoo 19 changes:
|
||||
- Use <list> not <tree>
|
||||
- Use direct attributes not attrs
|
||||
- Use @api.ondelete for delete validation
|
||||
```
|
||||
.claude/skills/
|
||||
└── odoo-19/
|
||||
└── SKILL.md -> ../../agent-skills/skills/odoo/19.0/SKILL.md
|
||||
```
|
||||
|
||||
### Key Odoo 19 Changes
|
||||
|
||||
| Change | Old | New |
|
||||
|--------|-----|-----|
|
||||
| List view tag | `<tree>` | `<list>` |
|
||||
| Dynamic attributes | `attrs="{'invisible': [...]}"` | `invisible="..."` |
|
||||
| Delete validation | Override `unlink()` | `@api.ondelete(at_uninstall=False)` |
|
||||
| Field aggregation | `group_operator=` | `aggregator=` |
|
||||
|
||||
---
|
||||
|
||||
## Repo (Continue fork)
|
||||
## Repository
|
||||
|
||||
### Step 1: Add to Repo Config
|
||||
**URL**: `git@github.com:unclecatvn/agent-skills.git`
|
||||
|
||||
Create `.repo/config.yaml`:
|
||||
|
||||
```yaml
|
||||
documentation:
|
||||
- /Users/unclecat/dtg/odoo-skills-19/skills/odoo/19.0/SKILL.md
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Swirl
|
||||
|
||||
### Step 1: Add to Swirl Config
|
||||
|
||||
Create `~/.config/swirl/rules.yaml`:
|
||||
|
||||
```yaml
|
||||
rules:
|
||||
- name: Odoo 19 Development
|
||||
documentation:
|
||||
- /Users/unclecat/dtg/odoo-skills-19/skills/odoo/19.0/SKILL.md
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Generic Setup (Any AI Tool)
|
||||
|
||||
For any AI tool that supports documentation:
|
||||
|
||||
1. **Add the SKILL.md path** to your documentation sources
|
||||
2. **Optionally add coding-style rules** from `CLAUDE.md`
|
||||
3. **Reload/restart** your AI tool
|
||||
4. **Test** by asking an Odoo 19 development question
|
||||
|
||||
### Example Prompt to Test
|
||||
|
||||
```
|
||||
How do I create a computed field in Odoo 19 with dotted dependencies?
|
||||
```
|
||||
|
||||
Expected answer should reference `odoo-19-decorator-guide.md` or `odoo-19-field-guide.md`.
|
||||
|
||||
---
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
### Skills Not Loading
|
||||
|
||||
1. Verify the path exists
|
||||
2. Check file permissions
|
||||
3. Ensure SKILL.md is valid YAML front matter
|
||||
|
||||
### Outdated Information
|
||||
|
||||
1. Pull latest changes from the skills repository
|
||||
2. Check version in SKILL.md matches your needs
|
||||
|
||||
### Specific IDE Issues
|
||||
|
||||
Check your IDE's documentation for:
|
||||
- How to configure documentation paths
|
||||
- How to reload configuration
|
||||
- Any specific syntax requirements
|
||||
|
||||
---
|
||||
|
||||
## Updating Skills
|
||||
|
||||
To update the Odoo 19 skills:
|
||||
|
||||
```bash
|
||||
cd /Users/unclecat/dtg/odoo-skills-19
|
||||
git pull origin main
|
||||
```
|
||||
|
||||
Then reload your AI tool.
|
||||
|
||||
---
|
||||
|
||||
## Feedback
|
||||
|
||||
For issues or suggestions:
|
||||
1. Check the guide files in `dev/`
|
||||
2. Refer to specific guide when reporting issues
|
||||
3. Include examples from your codebase
|
||||
**License**: MIT
|
||||
|
||||
@@ -11,7 +11,7 @@ The `skills/odoo/19.0/dev/` directory contains modular guides for Odoo 19 develo
|
||||
```
|
||||
skills/odoo/19.0/
|
||||
├── SKILL.md # Master index
|
||||
├── dev/ # Development guides (18 files)
|
||||
├── dev/ # Development guides (19 files)
|
||||
│ ├── odoo-19-actions-guide.md # ir.actions.*, cron, bindings
|
||||
│ ├── odoo-19-controller-guide.md # HTTP, routing, controllers
|
||||
│ ├── odoo-19-data-guide.md # XML/CSV data files, records
|
||||
|
||||
@@ -5,6 +5,29 @@ globs: "**/*.{py,xml}"
|
||||
license: MIT
|
||||
author: UncleCat
|
||||
version: 1.0.0
|
||||
topics:
|
||||
- Actions (ir.actions.*, cron, bindings)
|
||||
- Controllers (HTTP, routing, web endpoints)
|
||||
- Data files (XML/CSV, records, shortcuts)
|
||||
- Decorators (@api.depends, @api.constrains, @api.ondelete)
|
||||
- Development (modules, manifest, wizards, reports)
|
||||
- Field types (Char, Text, Monetary, relational fields)
|
||||
- Manifest (__manifest__.py configuration)
|
||||
- Mixins (mail.thread, activities, aliases, tracking)
|
||||
- Model methods (ORM, CRUD, search, domain)
|
||||
- Migration (upgrading modules, data migration)
|
||||
- OWL components (hooks, services, UI)
|
||||
- Performance (N+1 prevention, optimization)
|
||||
- Reports (QWeb, PDF/HTML, templates)
|
||||
- Security (ACL, record rules, field permissions)
|
||||
- Testing (unit tests, browser tests, mocking)
|
||||
- Transactions (savepoints, errors, serialization)
|
||||
- Translation (i18n, localization, PO files)
|
||||
- Views & XML (list, form, search, QWeb)
|
||||
when_to_use:
|
||||
- Finding the appropriate guide for an Odoo 19 task
|
||||
- Understanding module structure and conventions
|
||||
- Looking up best practices for specific Odoo features
|
||||
---
|
||||
|
||||
# Odoo 19 Skill - Master Index
|
||||
@@ -308,6 +331,11 @@ All guides are based on analysis of Odoo 19 source code:
|
||||
- `odoo/addons/base/models/res_lang.py` - Language model
|
||||
- `addons/web/static/src/core/l10n/translation.js` - JS translations
|
||||
|
||||
## External Documentation
|
||||
|
||||
- [Odoo 19 Official Documentation](https://github.com/odoo/documentation/tree/19.0) - Official Odoo 19 documentation on GitHub
|
||||
- [Odoo 19 Developer Reference](https://github.com/odoo/documentation/blob/19.0/developer/reference/orm.rst) - ORM API reference
|
||||
|
||||
---
|
||||
|
||||
**For setup instructions with different AI IDEs, see [AGENTS.md](./AGENTS.md)**
|
||||
|
||||
Reference in New Issue
Block a user