Langsung ke konten
Skillpedia
API & server (backend)48k Β· #5350

odoo-rpc-api

Fungsinya

Agen ini membantu Anda menghubungkan program lain ke Odoo, sebuah sistem manajemen bisnis. Anda bisa membaca, membuat, memperbarui, dan menghapus informasi di dalam Odoo menggunakan kode.

Kapan dipakai

  • βœ“Menghubungkan website atau aplikasi ke Odoo.
  • βœ“Mengotomatisasi impor atau ekspor data dari Odoo.
  • βœ“Mengintegrasikan Odoo dengan alat lain yang digunakan perusahaan Anda.

Link skill

https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/odoo-rpc-api/SKILL.md

Salin lalu tempelkan ke AI Anda (Claude, ChatGPT, atau Cursor) dan minta AI mengikuti instruksinya.

Cara pakai

Cara paling mudah: salin pesan ini dan tempelkan ke AI Anda. AI akan membaca skill dan mengikuti instruksinya.

Pesan siap tempel

Gunakan skill ini untuk membantu saya: https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/odoo-rpc-api/SKILL.md Baca file SKILL.md di link tersebut dan ikuti instruksinya untuk tugas saya.
Mau AI Anda menemukan skill seperti ini sendiri?Pasang MCP Skillpedia gratis: cukup satu baris, dan AI mencari di antara 15.000+ skill sebelum tiap tugas.Pasang dalam 1 menit β†’

Contoh permintaan ke AI

β€œBagaimana cara menghubungkan website saya ke Odoo untuk mengambil nama pelanggan?”

5 skill baru setiap minggu. 1 menit baca.

Cara kerjanya

Anda memberi tahu informasi apa yang ingin Anda akses atau ubah di Odoo. Saya akan membuat kode yang diperlukan dalam bahasa seperti Python atau JavaScript untuk membuat koneksi tersebut dan menjalankan operasinya.

Konten teknis (SKILL.md asli)

Teks asli dari pembuat, dalam bahasa Inggris, langsung dari GitHub.

Odoo RPC API

Overview

Odoo exposes a powerful external API via JSON-RPC and XML-RPC, allowing any external application to read, create, update, and delete records. This skill guides you through authenticating, calling models, and building robust integrations.

When to Use This Skill

  • Connecting an external app (e.g., Django, Node.js, a mobile app) to Odoo.
  • Running automated scripts to import/export data from Odoo.
  • Building a middleware layer between Odoo and a third-party platform.
  • Debugging API authentication or permission errors.

How It Works

  1. Activate: Mention @odoo-rpc-api and describe the integration you need.
  2. Generate: Get copy-paste ready RPC call code in Python, JavaScript, or curl.
  3. Debug: Paste an error and get a diagnosis with a corrected call.

Examples

Example 1: Authenticate and Read Records (Python)

import os
import xmlrpc.client

url = 'https://myodoo.example.com'
db = 'my_database'
username = 'admin'
password = os.environ["ODOO_API_KEY"]  # Use API keys, not passwords, in production

# Step 1: Authenticate
common = xmlrpc.client.ServerProxy(f'{url}/xmlrpc/2/common')
uid = common.authenticate(db, username, password, {})
print(f"Authenticated as UID: {uid}")

# Step 2: Call models
models = xmlrpc.client.ServerProxy(f'{url}/xmlrpc/2/object')

# Search confirmed sale orders
orders = models.execute_kw(db, uid, password,
    'sale.order', 'search_read',
    [[['state', '=', 'sale']]],
    {'fields': ['name', 'partner_id', 'amount_total'], 'limit': 10}
)
for order in orders:
    print(order)

Example 2: Create a Record (Python)

new_partner_id = models.execute_kw(db, uid, password,
    'res.partner', 'create',
    [{'name': 'Acme Corp', 'email': 'info@acme.com', 'is_company': True}]
)
print(f"Created partner ID: {new_partner_id}")

Example 3: JSON-RPC via curl

curl -X POST https://myodoo.example.com/web/dataset/call_kw \
  -H "Content-Type: application/json" \
  -d '{
    "jsonrpc": "2.0",
    "method": "call",
    "id": 1,
    "params": {
      "model": "res.partner",
      "method": "search_read",
      "args": [[["is_company", "=", true]]],
      "kwargs": {"fields": ["name", "email"], "limit": 5}
    }
  }'
# Note: "id" is required by the JSON-RPC 2.0 spec to correlate responses.
# Odoo 16+ also supports the /web/dataset/call_kw endpoint but
# prefer /web/dataset/call_kw for model method calls.

Best Practices

  • βœ… Do: Use API Keys (Settings β†’ Technical β†’ API Keys) instead of passwords β€” available from Odoo 14+.
  • βœ… Do: Use search_read instead of search + read to reduce network round trips.
  • βœ… Do: Always handle connection errors and implement retry logic with exponential backoff in production.
  • βœ… Do: Store credentials in environment variables or a secrets manager (e.g., AWS Secrets Manager, .env file).
  • ❌ Don't: Hardcode passwords or API keys directly in scripts β€” rotate them and use env vars.
  • ❌ Don't: Call the API in a tight loop without batching β€” bulk operations reduce server load significantly.
  • ❌ Don't: Use the master admin password for API integrations β€” create a dedicated integration user with minimum required permissions.

Limitations

  • Does not cover OAuth2 or session-cookie-based authentication β€” the examples use API key (token) auth only.
  • Rate limiting is not built into the Odoo XMLRPC layer; you must implement throttling client-side.
  • The XML-RPC endpoint (/xmlrpc/2/) does not support file uploads β€” use the REST-based ir.attachment model via JSON-RPC for binary data.
  • Odoo.sh (SaaS) may block some API calls depending on plan; verify your subscription supports external API access.
Pertanyaan umum

Bisakah saya menggunakan password Odoo biasa?

Disarankan menggunakan API key daripada password untuk keamanan yang lebih baik, terutama di lingkungan produksi. Agen ini dapat menunjukkan caranya.

Apa itu JSON-RPC dan XML-RPC?

Keduanya adalah cara standar bagi program untuk saling berkomunikasi melalui internet. Odoo menggunakan metode ini agar sistem lain dapat berinteraksi dengannya.

Bisakah agen ini membuatkan pelanggan baru di Odoo untuk saya?

Bisa. Agen ini dapat membuat kode untuk membuat data baru, seperti pelanggan, order, dan data lainnya di Odoo.

Detail

Deskripsi asli dari pembuat

Expert on Odoo's external JSON-RPC and XML-RPC APIs. Covers authentication, model calls, record CRUD, and real-world integration examples in Python, JavaScript, and curl.

repo: sickn33/agentic-awesome-skills

Popularitas

Bintang GitHub
48k
Peringkat
#5350
Lisensi
MIT
Diperbarui
15/10/2026

Apakah skill ini berguna?

0

Masuk untuk memberi suara.

Komentar

  • …

Skill lain dari repositori ini

Skill serupa