odoo logo

odoo

odoo

marcfargas/odoo-toolbox119installs34stars

SKILL.md

Full skill instructions

/odoo

Odoo ERP integration. Two ways to work: CLI (fastest for most tasks) and Library (for scripts and automation).

Two Ways to Work with Odoo

CLI — Fastest for Most Tasks

The odoo CLI lets you search, create, update, and delete records without writing any code.

# 1. Verify connection (always do this first)
odoo config check

# 2. Search records
odoo records search res.partner --fields name,email --limit 5

# 3. Create a record
odoo records create res.partner --data '{"name":"Acme Corp"}' --confirm

# 4. Post a note on a record
odoo mail note crm.lead 42 "Called customer" --confirm

Library — For Scripts and Automation

import { createClient } from '@marcfargas/odoo-client';

const client = await createClient();  // reads ODOO_URL, ODOO_DB, ODOO_USER, ODOO_PASSWORD

const partners = await client.searchRead('res.partner', [['is_company', '=', true]], {
  fields: ['name', 'email'],
  limit: 10,
});

await client.mail.postInternalNote('crm.lead', 42, '<p>Called customer.</p>');
await client.modules.isModuleInstalled('sale');

Quick Start

Step 1: Configure Environment

export ODOO_URL=https://mycompany.odoo.com
export ODOO_DB=mycompany
export ODOO_USER=admin
export ODOO_PASSWORD=yourpassword

Step 2: Verify Connection

odoo config check
# ✓ Connected to https://mycompany.odoo.com (db: mycompany)
#   User: Administrator (admin) [id: 2]
#   Installed modules: 143

Step 3: Explore

# Search for records
odoo records search res.partner --fields name,email --limit 10

# Introspect schema
odoo schema fields crm.lead --type many2one

# Check installed modules
odoo modules list --filter installed --search sale

CLI Exit Codes

All odoo CLI commands use these standard exit codes:

CodeMeaning
0Success
1Usage error (bad flags, missing --confirm, invalid arguments)
2Auth / network error (wrong credentials, Odoo unreachable)
3Not found
4Permission denied
5Validation error (Odoo rejected the values)
6Conflict (e.g., already clocked in)
10Partial success

Use in scripts:

odoo records get crm.lead 42 || echo "Exit code: $?"

CLI Command Reference

CLI CommandSkill DocDescription
odoo config check/showcli/config.mdVerify connection, show resolved config
odoo records search/get/create/write/delete/count/callcli/records.mdGeneric CRUD on any model
odoo schema models/fields/describe/codegenbase/introspection.mdDiscover models and fields
odoo modules list/install/uninstall/upgrade/info/statusbase/modules.mdManage Odoo modules
odoo url record/portalbase/urls.mdGenerate version-agnostic record URLs
odoo mail note/postmail/chatter.mdPost notes and messages on chatters
odoo attendance clock-in/clock-out/status/listmodules/attendance.mdEmployee clock in/out
odoo timesheets start/stop/running/log/listmodules/timesheets.mdTime tracking
odoo accounting cash-accounts/cash-balance/posted-moves/trace-recon/days-to-paymodules/accounting.mdRead-only accounting queries
odoo state plan/apply/diffcli/state.mdExperimental: state management

Library API

Service Accessors

Domain-specific helpers are accessed via lazy getters on the client:

AccessorCLI CommandDescriptionSkill doc
client.mail.*odoo mailPost notes & messages on chattermail/chatter.md
client.modules.*odoo modulesInstall, uninstall, check modulesbase/modules.md
client.urls.*odoo urlGenerate version-agnostic record URLsbase/urls.md
client.properties.*Safe operations for properties fieldsbase/properties.md
client.cdc.*Change Data Capture — field change history via mail.tracking.valuemodules/cdc.md
client.accounting.*odoo accountingCash discovery, reconciliation, partner resolutionmodules/accounting.md
client.attendance.*odoo attendanceClock in/out, presence trackingmodules/attendance.md
client.timesheets.*odoo timesheetsTimer start/stop, time loggingmodules/timesheets.md

Core CRUD (searchRead, create, write, unlink, etc.) stays directly on client.

Safety Model

OperationLevelNotes
client.search(), searchRead(), read(), searchCount()READ
client.create()WRITE
client.write()WRITE
client.unlink()DESTRUCTIVEPermanent deletion
client.call()VARIESDepends on method — check per-skill docs
client.mail.postInternalNote()WRITEInternal only, no emails sent
client.mail.postOpenMessage()DESTRUCTIVESends email to followers (may be external)
client.modules.isModuleInstalled()READ
client.modules.installModule()DESTRUCTIVESchema change, hard to rollback
client.modules.uninstallModule()DESTRUCTIVEDeletes module data, irreversible
client.properties.*WRITESafe property updates, prevents data loss
client.accounting.*READAll accounting helpers are read-only
client.timesheets.logTime(), startTimer(), stopTimer()WRITE
client.attendance.*WRITEClock in/out
client.urls.*READPure URL construction, no RPC

Prerequisites (Must Read First)

Before any Odoo operation, load these foundational modules:

  1. base/connection.mdcreateClient(), authentication, environment variables
  2. base/field-types.md — Odoo type system (read/write asymmetry)
  3. base/domains.md — Query filter syntax

Additional Modules

Load as needed by reading base/{name}.md:

ModuleCLI CoverageDescription
introspectionodoo schemaDiscover models & fields
crudodoo recordsCreate, read, update, delete patterns
searchodoo records searchSearch & filtering patterns
propertiesDynamic user-defined fields
modulesodoo modulesModule lifecycle management
urlsodoo urlVersion-agnostic record URL generation
multi-companyodoo records search --contextMulti-company context, allowed_company_ids, common gotchas
translationsRead and write field translations (Odoo 17+, ir.translation removed)
context-keys--context flagMail/chatter context keys: tracking_disable, mail_notrack, mail_create_nolog, etc.

Mail & Messaging

Skills for Odoo's mail system. Load by reading mail/{name}.md:

ModuleCLI CoverageDescription
chatterodoo mailPost messages and notes on records (client.mail.*)
activitiesSchedule and manage activities/tasks
discussChat channels and direct messages

Note: The mail module is part of base Odoo and is typically always installed.

Module-Specific Skills

Skills that require specific Odoo modules to be installed. Before loading, verify the required modules are present.

# CLI: check a module is installed
odoo modules status hr_attendance
// Library: check a module is installed
await client.modules.isModuleInstalled('hr_attendance')

Load by reading the path shown below:

SkillPathCLI CommandRequired ModulesDescription
accountingmodules/accounting.mdodoo accountingaccountAccounting patterns, cashflow, reconciliation, PnL, validation
contractsmodules/contracts.mdcontract (OCA)Recurring contracts, billing schedules, revenue projection
attendancemodules/attendance.mdodoo attendancehr_attendanceClock in/out, presence tracking (client.attendance.*)
timesheetsmodules/timesheets.mdodoo timesheetshr_timesheetTimer start/stop, time logging on projects (client.timesheets.*)
mis-builderoca/mis-builder.mdmis_builder, date_range, report_xlsxMIS Builder — reading, computing, exporting reports
mis-builder-devoca/mis-builder-dev.mdmis_builder, date_range, report_xlsxMIS Builder — creating & editing report templates
product-configuratormodules/product-configurator.mdsale_product_configuratorProduct attributes & variants on sale lines — no_variant, price_extra, custom values