본문으로 건너뛰기
cccskills
무료GitHub에 공개

odoo-test-writer

Create and improve Odoo custom module tests using the Odoo test framework. Use when the user asks to add tests, create TransactionCase/HttpCase tests, test Odoo business logic, mock external APIs, use Form helper, test access rules, test workflows, or improve Odoo test coverage.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

설치 방법 보기

포함된 파일(3)

  • SKILL.md3.5 KB
  • ODOO-TESTING-EXAMPLES.md7.4 KB
  • ODOO-TESTING-SOP.md7.4 KB

SKILL.md(원문)

설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.

Odoo Test Writer

Use this skill to add practical tests for Odoo custom modules. Prefer tests at the Odoo behavior seam: ORM flows, constraints, computes, access rules, controllers, reports, forms, workflows, and integration boundaries.

First Move

Before writing tests:

  • Identify the addon/module and target Odoo version.
  • Inspect __manifest__.py, models/, views/, security/, controllers/, report/, static/src/, existing tests/, and relevant docs.
  • If $ODOO_SOURCE is set, inspect local test helpers and framework behavior instead of guessing.

Choose The Test Type

  • Use TransactionCase for most model/business-logic tests. Each test runs in a savepoint and rolls back.
  • Use AccountTestInvoicingCommon for accounting tests needing companies, products, partners, taxes, journals, or invoices.
  • Use Form helper when testing default values, onchanges, form validations, One2many/Many2many form behavior, or user-like form flows.
  • Use HttpCase for browser, tour, website, portal, controller, or full UI flows.
  • Use SingleTransactionCase only for read-only suites or expensive setup where cross-test state is acceptable.
  • Use unittest.mock.patch/MagicMock for external APIs, payment gateways, OAuth, webhooks, file system, time, or slow services. Do not mock Odoo internals unless there is no better seam.

Required Structure

your_module/
├── __init__.py              # Do not import tests here
├── __manifest__.py
├── tests/
│   ├── __init__.py          # Import test modules here
│   ├── common.py            # Optional shared fixtures/helpers
│   └── test_*.py            # Test files

Every new test_*.py must be imported from tests/__init__.py, or the Odoo test runner will not discover it.

Writing Workflow

  1. Map the behavior to prove and the smallest Odoo seam that proves it.
  2. Add or update tests/common.py only for reusable fixtures/helpers.
  3. Create fresh mutable records inside each test unless immutable setup belongs in setUpClass.
  4. Use Arrange, Act, Assert sections in test method body.
  5. Test happy path, validation/error path, and relevant side effects.
  6. For access/security changes, test realistic users/groups/companies with with_user().
  7. For external integrations, patch the boundary where it is used, then assert both state changes and mock calls.
  8. For performance-sensitive code, add assertQueryCount when supported by the target version/test base.
  9. Update tests/__init__.py and manifest dependencies only when evidence requires it.
  10. For OWL components, services, registries, and field widgets, compose with odoo-web-testing and its OWL-TESTING.md reference.

Tags

Default pattern for post-install module tests:

from odoo.tests import tagged

@tagged("post_install", "-at_install")
class TestYourFeature(YourModuleTestCommon):
    pass

References

  • See ODOO-TESTING-SOP.md for the SOP, terminology, tags, and troubleshooting.
  • See ODOO-TESTING-EXAMPLES.md for ready-to-adapt test patterns.
  • Compose with odoo-code-tracer when you need to trace the behavior before writing tests.
  • Compose with odoo-code-review when reviewing test coverage or test quality.

리뷰

아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.

댓글

로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.

아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.

보내면 바로 공개됩니다. 이메일 주소나 전화번호 같은 개인 정보는 쓰지 마세요. URL은 2개까지입니다.

0 / 1,000자

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

같은 저장소의 스킬

grill-me

무료

Interview the user relentlessly about a plan or design until reaching shared understanding, resolving each branch of the decision tree. Use when the user wants to stress-test a plan, get grilled on their design, or mentions "grill me" outside an Odoo-specific context.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

mart337i/odoo-skills592026년 10월 2일 업데이트

Grilling session that challenges your plan against the existing domain model, sharpens terminology, and updates documentation (CONTEXT.md, ADRs) inline as decisions crystallise. Use when the user wants to stress-test a plan against their project's language and documented decisions.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

mart337i/odoo-skills592026년 10월 2일 업데이트

Find deepening opportunities in a codebase, informed by the domain language in CONTEXT.md and the decisions in docs/adr/. Use when the user wants to improve architecture, find refactoring opportunities, consolidate tightly-coupled modules, or make a codebase more testable and AI-navigable.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

mart337i/odoo-skills592026년 10월 2일 업데이트

odoo

무료

Odoo engineering workflows for addon development, codebase exploration, debugging, architecture/refactor review, manifest/docs sync, and routing to migration work. Use when the user mentions Odoo, addons, modules, manifests, models, XML views, security CSVs, record rules, Odoo shell, OWL/QWeb/assets, or when an Odoo codebase is detected.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

mart337i/odoo-skills592026년 10월 2일 업데이트

odoo-17.0

무료

Odoo 17 development reference for Python models and ORM (search, domain, read_group, compute fields), XML/CSV data and views, OWL/JS client code, QWeb reports, security (ACL, record rules, groups), cron and server actions, migrations and module upgrades, tests, i18n, and performance. Use this skill whenever work involves Odoo 17 or custom addons, including traceback diagnosis, addons, manifests, XML errors, HTTP controllers, business rules, feature work, refactoring, or reviews.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

mart337i/odoo-skills592026년 10월 2일 업데이트

odoo-18.0

무료

Odoo 18 development reference for Python models and ORM (search, domain, read_group, compute fields), XML/CSV data and views, OWL/JS client code, QWeb reports, security (ACL, record rules, groups), cron and server actions, migrations and module upgrades, tests, i18n, and performance. Use this skill whenever work involves Odoo 18 or custom addons, including traceback diagnosis, addons, manifests, XML errors, HTTP controllers, business rules, feature work, refactoring, or reviews.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

mart337i/odoo-skills592026년 10월 2일 업데이트

mart337i의 스킬 모두 보기

이 스킬의 문제 신고