Documentation

Odoo Agent

The Odoo Agent is a specialized component designed to interact with Odoo ERP systems, manage business operations, and handle data through the Odoo API.

Odoo Agent Component

Odoo Agent interface and configuration options

Configuration Parameters

Required Parameters

  • Language Model: The language model to use
  • Odoo URL: The Odoo instance URL
  • Database Name: Odoo database name
  • Username: Odoo user credentials
  • Password/API Key: Authentication credentials
  • Resource Type: Target Odoo model/resource
  • Natural Instruction: Operation to perform

Optional Parameters

  • Results Limit: Maximum number of records to return

Output Format

{
  "operationId": string,
  "status": "success" | "error",
  "results": {
    "data": array,
    "count": number,
    "metadata": {
      "model": string,
      "fields": array,
      "timestamp": string
    }
  },
  "operation": {
    "type": string,
    "parameters": object,
    "explanation": string
  }
}

Example Usage

const odooAgent = new OdooAgent({
  languageModel: "gpt-4",
  odooUrl: "https://mycompany.odoo.com",
  databaseName: "company_db",
  username: "admin",
  password: "api_key_xyz",
  resourceType: "res.partner",
  resultsLimit: 10
});

const result = await odooAgent.execute({
  naturalInstruction: "Find all contacts in France",
  options: {
    fields: ["name", "email", "phone", "country_id"],
    domain: [["country_id.code", "=", "FR"]]
  }
});

Best Practices

  • Use API keys instead of passwords when possible
  • Implement proper error handling
  • Cache frequently accessed data
  • Use appropriate field selection
  • Handle pagination for large datasets