From claude-odoo-dev
This skill should be used when the user asks to "spin up a test Odoo", "create a test environment", "run integration tests against Odoo", "set up testcontainers for Odoo", "provision test data", or mentions Docker-based Odoo testing.
How this skill is triggered — by the user, by Claude, or both
Slash command
/claude-odoo-dev:test-environmentsThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Spin up fresh, isolated Odoo instances for testing using Testcontainers. Each test run gets its own PostgreSQL + Odoo container with automatic cleanup.
Spin up fresh, isolated Odoo instances for testing using Testcontainers. Each test run gets its own PostgreSQL + Odoo container with automatic cleanup.
npm install @marcfargas/odoo-testcontainers @marcfargas/odoo-client
import { startOdoo } from '@marcfargas/odoo-testcontainers';
const container = await startOdoo({
version: '17.0',
modules: ['sale', 'purchase'],
});
// container.url, container.database, container.username, container.password
// Use with createClient() from @marcfargas/odoo-client
await container.stop();
Pre-configured module sets for common scenarios:
import { startOdoo, OdooPresets } from '@marcfargas/odoo-testcontainers';
await startOdoo({ ...OdooPresets.hr }); // hr, hr_attendance, hr_timesheet
await startOdoo({ ...OdooPresets.sales }); // sale, sale_management, crm
await startOdoo({ ...OdooPresets.accounting }); // account, account_payment
await startOdoo({ ...OdooPresets.project }); // project, project_todo
await startOdoo({ ...OdooPresets.full }); // all common modules
Mount local addon directories into the container:
await startOdoo({
version: '17.0',
addons: [{ hostPath: './my-addons', containerPath: '/mnt/extra-addons' }],
modules: ['my_custom_module'],
});
For faster startup (~15s vs ~3min), use a pre-seeded database image:
export ODOO_SEED_IMAGE=ghcr.io/marcfargas/odoo-test-db:17.0-abc123
The toolbox CI builds seed images weekly. Configure in docker/seed-config.json.
Opt-in helpers for creating test data shapes:
import {
provisionPartners,
provisionProjects,
provisionUsers,
provisionModules,
provisionPartnerCategories,
provisionTaskProperties,
} from '@marcfargas/odoo-testcontainers';
Each provisioner takes an authenticated OdooClient and a configuration object. They handle dependency ordering (e.g., partner categories before partners, projects before tasks).
// vitest.integration.config.mts
export default defineConfig({
test: {
globalSetup: './tests/helpers/globalSetup.ts',
include: ['tests/**/*.integration.test.ts'],
pool: 'forks',
fileParallelism: false,
},
});
The global setup starts containers once, sets env vars, and tears down after all tests complete.
Odoo 17, 18, and 19 are tested in CI. Specify the version in startOdoo({ version: '18.0' }).
npx claudepluginhub marcfargas/claude-odoo-devWrites and runs Odoo automated tests including TransactionCase, HttpCase, and browser tours. Covers test data setup, mocking, and CI execution.
Generates production-ready Docker Compose and config files for Odoo with PostgreSQL, persistent volumes, Nginx reverse proxy, and environment configs. For dev setups, VPS/cloud deploys, and troubleshooting container/DB errors.
Provides Odoo 17 development references for Python models, ORM, XML views/data, OWL/JS client code, QWeb reports, security, cron actions, migrations, tests, and performance. Ideal for building, fixing, refactoring, or reviewing custom addons.