Upgrade Odoo node from execute to execute_kw (enables context, kwargs, and service user support)

Summary

The built-in Odoo node uses Odoo’s legacy execute JSON-RPC method, which does not support keyword arguments (kwargs). This means it is fundamentally impossible to pass context values — a core Odoo API concept required for proper, secure integrations.

The modern Odoo API method execute_kw (available since Odoo 8, released 2014) supports both positional args and kwargs, including context. Switching to execute_kw would unlock major functionality without breaking existing workflows.

The Core Technical Issue

Current implementation (GenericFunctions.ts):

const methodJSONRPC = 'execute';
// Call signature: [db, uid, password, model, method, ...positional_args]
// No kwargs possible

What it should be:

const methodJSONRPC = 'execute_kw';
// Call signature: [db, uid, password, model, method, [args], {kwargs}]
// Context, domain filters, field lists, limits all go in kwargs

The execute method has been effectively deprecated since Odoo 8 (2014). All official Odoo documentation, the Odoo external API reference, and the Odoo XML-RPC tutorial exclusively use execute_kw. The current node is built on a 12-year-old API method.

Why This Matters: The Licensing & Security Problem

Odoo charges per internal (backend) user — typically €20–50/month per user depending on the plan. Odoo has two user types:

User type Cost API access Limitations
Internal user Paid (per seat) Full Full backend access — overpowered for integrations
Portal user Free (unlimited) XML-RPC works Fails on models with mail.thread inheritance due to hardcoded checks

The problem: When a portal user creates a record on a model that inherits mail.thread (which is ~80% of all business models in Odoo — sales orders, invoices, tickets, tasks, etc.), Odoo automatically tries to:

  • Subscribe followers (message_subscribe)

  • Post creation log messages (message_post)

  • Track field changes

These operations have hardcoded Python checks for base.group_user (internal user). They fail with “Access Denied” — not because of missing ACL rules, but because of framework-level constraints.

The solution is simple: Odoo provides official context keys to disable these automatic behaviors:

Context key Effect
mail_create_nosubscribe Skip auto-subscribing partner as follower
mail_create_nolog Skip “Record created” chatter message
tracking_disable Skip all field change tracking
mail_notrack Skip tracking on write operations

With these context values, a free portal user with proper ACL rules can successfully perform all CRUD operations via XML-RPC. This is a well-documented, officially supported Odoo pattern.

But the current n8n Odoo node makes this impossible because execute doesn’t support kwargs, so there’s no way to pass context — regardless of UI changes.

Impact on n8n Users

Without context support, every n8n user integrating with Odoo is forced into one of these bad options:

  1. Pay for a dedicated internal user license per integration (€20-50/month each) — purely for API access, wasteful

  2. Share one powerful admin API key across all integrations — security anti-pattern, no audit trail, too much privilege

  3. Use the HTTP Request node with raw JSON-RPC payloads — losing all benefits of the native Odoo node (credential management, resource/model discovery, operation dropdown, field mapping)

  4. Install a community node (@marcfargas/n8n-nodes-odoo) — not available on n8n Cloud for unverified nodes

Proposed Solution

Minimum viable change: Replace execute with execute_kw in GenericFunctions.ts. This is largely a payload restructuring — the JSON-RPC transport is identical.

Suggested UI additions (once execute_kw is supported):

  1. Context section (key-value or JSON) — for passing arbitrary context values

  2. Mail/Tracking toggles — checkboxes for the common mail context flags (similar to what @marcfargas/n8n-nodes-odoo already implements)

  3. Domain filter — proper Odoo domain syntax support for Get Many/Search operations (also requires kwargs)

  4. Fields list — specify which fields to return on read (also kwargs)

  5. Limit/Offset — pagination support (also kwargs)

Proof That This Works

The community node @marcfargas/n8n-nodes-odoo (March 2026) already implements this correctly:

  • Uses execute_kw

  • Provides UI toggles for all mail context flags

  • Supports custom context, domain filters, field selection

  • Enables free portal users to work with mail.thread models

This validates that the approach works and that there’s user demand.

Additional Use Cases Unlocked by Context Support

Context key Use case
{'lang': 'de_DE'} Create/read records in a specific language
{'tz': 'Europe/Berlin'} Correct datetime interpretation
{'active_test': False} Include archived records in search
{'allowed_company_ids': [1, 2]} Multi-company operations
{'default_type': 'out_invoice'} Set default field values on create
{'force_delete': True} Allow permanent deletion

Environment

  • n8n version: 2.17.5 (Cloud)

  • Odoo versions affected: All (8.0 through 18.0) — execute_kw is the standard since 2014

  • Node: n8n-nodes-base.odoo (v1 Latest)

  • Source file: packages/nodes-base/nodes/Odoo/GenericFunctions.ts

References