Skip to content

Conversation

@lucianobustos
Copy link

@lucianobustos lucianobustos commented Nov 18, 2025

Implements locale support allowing Odoo API responses in different languages via the ODOO_LOCALE environment variable.

Changes

  • Add ODOO_LOCALE environment variable to configuration
  • Inject lang context into all execute_kw calls
  • Preserve existing context values when adding locale
  • Return translated field labels, selection values, and record names
  • Add comprehensive test suite for locale functionality
  • Document locale support in README with examples

Usage

Set ODOO_LOCALE in your MCP configuration:

{
  "mcpServers": {
    "odoo": {
      "command": "uvx",
      "args": ["mcp-server-odoo"],
      "env": {
        "ODOO_URL": "https://your-instance.odoo.com",
        "ODOO_API_KEY": "your-api-key",
        "ODOO_DB": "your-database",
        "ODOO_LOCALE": "es_AR"
      }
    }
  }
}

Breaking Changes

None - backward compatible. Existing configurations without ODOO_LOCALE work as before.

Close #23

Implements comprehensive locale support allowing Odoo responses in different languages.

Changes:
- Add ODOO_LOCALE environment variable to configuration
- Inject lang context into all execute_kw calls
- Preserve existing context values when adding locale
- Return translated field labels, selection values, and record names
- Add comprehensive test suite for locale functionality
- Document locale support in README with examples

Tested with es_AR (Spanish Argentina) successfully translating:
- Field labels and metadata
- Selection values
- Record names (when translations exist in Odoo)
- Error messages

Supports any locale installed in the Odoo instance including:
es_ES, es_AR, es_MX, en_US, en_GB, fr_FR, pt_BR, de_DE, and more.

🤖 Generated with Lucho Code
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add Locale Support to query in another language.

1 participant