Creates comprehensive test suites for Odoo 16.0 modules following Siafa project standards. This skill should be used when creating tests for Odoo modules, such as "Create tests for this module" or "Generate test cases for stock_location_usage_restriction" or "Add unit tests to validate this functionality". The skill provides test templates, patterns, and best practices specific to Odoo 16.0 Enterprise with knowledge of database constraints and common pitfalls in the Siafa codebase.
View on GitHubjamshu/jamshi-marketplace
odoo-dev
January 22, 2026
Select agents to install to:
npx add-skill https://github.com/jamshu/jamshi-marketplace/blob/main/plugins/odoo-dev/skills/odoo-test-creator/SKILL.md -a claude-code --skill odoo-test-creatorInstallation paths:
.claude/skills/odoo-test-creator/# Odoo Test Creator
## Overview
Create production-ready test suites for Odoo 16.0 Enterprise modules that follow Siafa project standards, handle database constraints properly, and provide comprehensive test coverage.
## When to Use This Skill
Use this skill when:
- Creating tests for new Odoo modules
- Adding test coverage to existing modules
- Validating model logic, constraints, and workflows
- Testing inherited/extended Odoo models
- Ensuring compliance with Siafa testing standards
## Test Creation Workflow
### Step 1: Analyze Module Structure
Examine the module to understand what needs testing:
1. **Identify Components to Test:**
- Models (new models or inherited models)
- Computed fields and @api.depends
- Constraints (@api.constrains and _sql_constraints)
- Onchange methods (@api.onchange)
- Business logic methods
- State transitions and workflows
- Wizards and transient models
- Reports (if applicable)
2. **Review Module Dependencies:**
- Check `__manifest__.py` for dependencies
- Identify which models from dependencies will be used
- Plan to use existing records when possible
3. **Check for Special Requirements:**
- Database constraints (NOT NULL, UNIQUE)
- Multi-company considerations
- Access rights and permissions
- Integration points with other modules
### Step 2: Set Up Test File Structure
Create the test file following Siafa standards:
```python
# -*- coding: utf-8 -*-
from odoo.tests.common import TransactionCase
from odoo.exceptions import UserError, ValidationError
class TestModuleName(TransactionCase):
"""Test cases for module_name functionality."""
def setUp(self):
"""Set up test data."""
super().setUp()
# Initialize model references
self.Model = self.env['model.name']
# Set up test data (Step 3)
```
**Critical Import Pattern:**
- ✅ Use `from odoo.tests.common import TransactionCase`
- ❌ NOT `from odoo.tests import TransactionCase`
###