Skip to content

feat(llm_export): add Odoo Export tool for AI-driven CSV export#258

Open
moctarjallo wants to merge 3 commits into
apexive:18.0from
moctarjallo:feat/llm-export
Open

feat(llm_export): add Odoo Export tool for AI-driven CSV export#258
moctarjallo wants to merge 3 commits into
apexive:18.0from
moctarjallo:feat/llm-export

Conversation

@moctarjallo

Copy link
Copy Markdown
Contributor

Summary

  • Adds a new llm_export module with an odoo_export LLM tool that exports any Odoo model's records as a file attached directly to the llm.thread conversation
  • Fields are either specified explicitly by the user (natural language → AI maps to field names) or auto-detected (all stored scalar fields)
  • Relational fields exported as IDs for re-importable output (many2one → id, many2many → comma-joined ids)
  • Format-dispatch architecture (_render_<format>) makes adding xlsx/json a one-method extension
  • Thread context injected server-side via env.context['message'] — the AI never needs to pass thread_id

Security

  • Blocked model denylist (res.users, ir.config_parameter, ir.mail_server, etc.) to prevent prompt-injection exfiltration
  • Sensitive field name denylist (password_crypt, totp_secret, api_key, etc.) excluded from auto-detected fields
  • CSV formula injection mitigation: values starting with =, +, -, @, \t, \r are prefixed with '
  • Attachment created without .sudo() — Odoo ACL enforces the calling user's own permissions

Test plan

  • Install llm_export and add odoo_export tool to an assistant
  • Ask: "export name, phone, email from res.partner" — file appears in chat
  • Ask: "export all products" (no fields) — all scalar fields exported, no sensitive fields included
  • Ask: "export res.users" — blocked with permission error
  • Open exported CSV in Excel — no formula execution on cells starting with =

🤖 Generated with Claude Code

moctarjallo and others added 3 commits June 4, 2026 23:52
Adds llm_export module with an odoo_export tool that the AI can invoke
to export any Odoo model's records as a CSV file attached directly to
the llm.thread conversation. Supports explicit field lists from the user
or auto-detection of all stored scalar fields. Format-dispatched via
_render_<format>() for future xlsx/json extension.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.

1 participant