Channels
Odoo Channel
OpenClaw channel plugin for Odoo Discuss — real-time messaging via WebSocket bus
Install
npm install
```
Configuration Example
{
"plugins": {
"entries": {
"odoo": { "enabled": true }
}
}
}
README
# openclaw-odoo-channel
OpenClaw channel plugin for **Odoo Discuss** — connects AI agents to Odoo's messaging system (Discuss channels, task chatter, project notes, etc.) via WebSocket bus for real-time notifications and JSON-RPC for posting.
## Features
- Real-time inbound messages via Odoo WebSocket bus
- Polling fallback for reliability
- Outbound message delivery via JSON-RPC `message_post`
- Multi-account support (one Odoo user per agent)
- Session keys map to Odoo records: `odoo:<host>:<model>:<res_id>`
- Automatic reconnection with configurable delay
- Presence updates to keep agents "online" in Odoo
## Installation
1. Copy (or symlink) this directory into your OpenClaw extensions folder:
```bash
cp -a /path/to/openclaw-odoo-channel ~/.openclaw/extensions/odoo
```
2. Install dependencies:
```bash
cd ~/.openclaw/extensions/odoo
npm install
```
3. Enable the plugin in `openclaw.json`:
```json
{
"plugins": {
"entries": {
"odoo": { "enabled": true }
}
}
}
```
## Configuration
Add Odoo account(s) under `channels.odoo` in `openclaw.json`:
```json
{
"channels": {
"odoo": {
"enabled": true,
"accounts": {
"my-agent": {
"url": "https://my-odoo.example.com",
"db": "my_database",
"login": "[email protected]",
"password": "secret"
}
}
}
}
}
```
### Account options
| Key | Type | Default | Description |
|-----|------|---------|-------------|
| `url` | string | *required* | Odoo instance base URL |
| `db` | string | *required* | Database name |
| `login` | string | *required* | Odoo user login (email) |
| `password` | string | *required* | Odoo user password |
| `reconnectDelay` | number | `5` | Seconds before reconnecting after disconnect |
| `pollInterval` | number | `15` | Seconds between poll cycles (fallback) |
### Binding agents to accounts
Route Odoo messages to specific agents using bindings:
```json
{
"bindings": [
{
"agentId": "my-agent",
"match": {
"channel": "odoo",
"accountId": "my-agent"
}
}
]
}
```
## Odoo requirements
- The Odoo user's **Notification** preference must be set to **Inbox** (not Email). Otherwise the plugin won't receive notifications.
- The user must be a member of / subscribed to the Discuss channels or records they should monitor.
## How it works
1. **Connect** — authenticates via JSON-RPC, captures session cookie
2. **Catch up** — fetches unread `mail.notification` records on startup
3. **Listen** — opens WebSocket to `/websocket`, subscribes to bus events
4. **Poll** — simultaneously polls for unread notifications as fallback
5. **Dispatch** — formats inbound messages and routes them to the bound OpenClaw agent
6. **Reply** — agent replies flow back through `message_post` on the originating Odoo record
## License
LGPL-3.0
channels
Comments
Sign in to leave a comment