node-red-contrib-odoo-jsonrpc 1.0.0

Modern Odoo connector for Node-RED. Supports JSON-RPC (Odoo 14-18) and JSON-2 API (Odoo 19+). Zero dependencies. Built for IoT and industrial automation.

npm install node-red-contrib-odoo-jsonrpc

node-red-contrib-odoo-jsonrpc

npm version Node-RED License: MIT Odoo

Modern Odoo connector for Node-RED with dual API support. The only actively maintained Odoo integration for Node-RED that supports both legacy JSON-RPC (Odoo 14-18) and the new JSON-2 API (Odoo 19+).

Zero external dependencies. Uses only Node.js built-in http/https modules.

Built and maintained by TechTonga - Odoo & IoT integration specialists.


Why This Package?

All existing Node-RED Odoo connectors (node-red-contrib-odoo, node-red-contrib-odoo-xmlrpc, etc.) rely on the deprecated XML-RPC protocol and have been abandoned since 2022. None support Odoo 17+ or the new JSON-2 API introduced in Odoo 19.

Feature This package node-red-contrib-odoo node-red-contrib-odoo-xmlrpc
Last update 2026 2022 2021
Odoo 19+ (JSON-2 API) Yes No No
Odoo 17/18 Yes Untested Untested
Protocol JSON-RPC + JSON-2 XML-RPC XML-RPC
API key auth Yes No No
IoT event bridge Yes No No
External dependencies 0 1 (xmlrpc) 1 (xmlrpc)
Node.js 18+ Yes No No

Nodes

odoo-server (config)

Configuration node that stores connection details. Supports two authentication modes:

  • JSON-RPC (Odoo 14-18): Username + password via /jsonrpc endpoint
  • JSON-2 (Odoo 19+): API key via /json/2/ REST endpoint

Includes automatic session caching and re-authentication on session expiry.

odoo-api

Full CRUD operations on any Odoo model:

Operation Description Input
search_read Search and read records msg.domain, msg.fields, msg.limit, msg.offset, msg.order
read Read specific records by ID msg.ids, msg.fields
search_count Count matching records msg.domain
create Create a new record msg.payload (values object)
write Update existing records msg.ids, msg.values
unlink Delete records msg.ids
execute_kw Call any custom method msg.method, msg.args, msg.kwargs
call_button Trigger an Odoo action/button msg.ids, msg.button

All parameters can be set in the node config or dynamically via msg properties.

odoo-event

MQTT-to-Odoo event bridge. Routes IoT events to Odoo methods based on MQTT topics:

Topic pattern Handler Odoo method
.../events Tool pickup/return, door events model.handle_container_event()
.../validate QR code validation model.validate_qr_code()
.../status/heartbeat Device heartbeat sync model.write() (update timestamps)

Designed for equipment rental and IoT scenarios, but the models are fully configurable.

Installation

cd ~/.node-red
npm install node-red-contrib-odoo-jsonrpc

Then restart Node-RED and look for the Odoo category in the palette.

Quick Start

1. Read partners from Odoo

[
    {
        "id": "inject1",
        "type": "inject",
        "name": "Get companies",
        "props": [
            { "p": "domain", "v": "[[\"is_company\",\"=\",true]]", "vt": "json" },
            { "p": "fields", "v": "[\"name\",\"email\",\"phone\"]", "vt": "json" },
            { "p": "limit", "v": "10", "vt": "num" }
        ],
        "wires": [["api1"]]
    },
    {
        "id": "api1",
        "type": "odoo-api",
        "name": "Read partners",
        "server": "server1",
        "operation": "search_read",
        "model": "res.partner",
        "wires": [["debug1"]]
    },
    {
        "id": "debug1",
        "type": "debug",
        "name": "Result",
        "active": true
    },
    {
        "id": "server1",
        "type": "odoo-server",
        "name": "My Odoo",
        "url": "http://localhost:8069",
        "database": "mydb",
        "apiVersion": "jsonrpc"
    }
]

2. Create a record

{
    "payload": {
        "name": "New Partner",
        "email": "[email protected]",
        "is_company": true
    },
    "model": "res.partner",
    "operation": "create"
}

3. IoT event bridge (MQTT to Odoo)

[MQTT In: devices/+/events] --> [odoo-event] --> [Debug]

Wire an MQTT subscriber to the odoo-event node. It automatically parses incoming IoT events and calls the appropriate Odoo methods.

Configuration

JSON-RPC (Odoo 14-18)

Field Description
URL Full URL of the Odoo server (e.g., http://localhost:8069)
Database Odoo database name
Username Odoo user login
Password Odoo user password

JSON-2 API (Odoo 19+)

Field Description
URL Full URL of the Odoo server
Database Odoo database name
API Key Odoo API key (generate in Settings > Users > API Keys)

Dynamic Parameters

All odoo-api parameters can be overridden at runtime via msg properties:

// In a function node before odoo-api:
msg.model = "sale.order";
msg.operation = "search_read";
msg.domain = [["state", "=", "sale"]];
msg.fields = ["name", "partner_id", "amount_total"];
msg.limit = 20;
msg.order = "date_order desc";
return msg;

Output

Every successful operation adds metadata to the message:

{
    "payload": [ ... ],
    "odoo": {
        "model": "res.partner",
        "operation": "search_read",
        "timestamp": "2026-02-14T10:30:00.000Z"
    }
}

Use Cases

  • IoT / Industrial: Bridge MQTT sensor data to Odoo Manufacturing, Maintenance, or Inventory
  • Equipment Rental: Automate rental lifecycle with smart locker/container events
  • E-commerce: Sync orders, stock levels, and customer data in real-time
  • Warehouse: Barcode/QR scanning workflows integrated with Odoo Inventory
  • Custom dashboards: Pull Odoo data into Node-RED Dashboard for real-time monitoring

Requirements

  • Node-RED >= 3.0.0
  • Node.js >= 18.0.0
  • Odoo 14, 15, 16, 17, 18, or 19+

License

MIT - see LICENSE

Contributing

Issues and pull requests are welcome on GitHub.

About TechTonga

TechTonga builds IoT-integrated business systems with Odoo. We specialize in:

  • Custom Odoo modules for rental, manufacturing, and logistics
  • IoT device integration (ESP32, industrial sensors, smart locks)
  • Node-RED automation flows for MQTT/Odoo bridges
  • End-to-end self-service and equipment rental platforms

Need Odoo + IoT integration? Get in touch

Node Info

Version: 1.0.0
Updated 2 days ago
License: MIT
Rating: not yet rated

Categories

Actions

Rate:

Downloads

0 in the last week

Nodes

  • odoo-server
  • odoo-api
  • odoo-event

Keywords

  • node-red
  • odoo
  • erp
  • jsonrpc
  • json2
  • iot
  • automation
  • manufacturing
  • mes
  • scada
  • industrial
  • odoo19
  • odoo18
  • odoo17
  • xmlrpc
  • rental
  • inventory

Maintainers