Skip to content

Steer the Odoo REST adapter away from fields Odoo 19 removed - #1215

Merged
helpcodeai merged 2 commits into
mainfrom
fix/odoo-rest-mobile-field
Oct 23, 2026
Merged

helpcodeai merged 2 commits into
mainfrom
fix/odoo-rest-mobile-field

Conversation

@helpcodeai

Copy link
Copy Markdown
Contributor

Summary

On Odoo 19 res.partner has no mobile field, but agents using the Odoo (REST, JSON-2) connector keep asking for it. Every such call fails with Invalid field 'mobile' on 'res.partner'. Over the last 30 days that error hit 19 workspaces on this adapter (101 failed calls). One customer has hit it every day for two weeks. The Odoo 14-18 (JSON-RPC) adapter already has a hint about this; the REST adapter, which is the Odoo 19 one, didn't.

The failing calls were all model-chosen arguments: fields in odoo_search_read (87) and odoo_read (4), values in odoo_create (4), and a few domains that filter on mobile. The shipped odoo_list_partners field list never included mobile, so no default list needed changing.

Changes

  • Instructions: new short paragraph on fields Odoo 19 dropped or renamed. It covers mobile (use phone) and title on res.partner, plus tax_id → tax_ids on sale.order.line. All three show up in production errors on this adapter, and tax_ids succeeds 239 times. It also says to check odoo_fields_get after an Invalid field error rather than repeat the call.
  • fields on odoo_search_read / odoo_read: ask for phone, not mobile, on res.partner.
  • values on odoo_create / odoo_write: put any phone number in phone.
  • Static spec: asserts the instructions and parameter hints, and that the partner wrapper's field list stays free of mobile.

catalog.ts doesn't change: the adapter JSON is imported, and the version is a content hash.

Type

  • Bug fix

Cloud and self-hosted

Same in both modes: these are description-only changes. On boot, CatalogReconciler applies safe-class updates (tool descriptions, parameters, and instructions the user hasn't edited) to installed connectors. So the 175 Odoo REST connectors already installed on Cloud (147 workspaces) pick this up on the next deploy, and no data patch is needed. A connector whose instructions were edited by hand keeps them, but it still gets the parameter hints. Self-hosted instances get the same on upgrade unless CATALOG_AUTOSYNC=false.

Testing

  • Added/updated unit tests

Commands, run from the repository root unless noted:

  • node scripts/validate-adapters.mjs --warn: exit 0. There are 1457 warnings both before and after the change, and none are for intl/odoo.json.
  • node scripts/regenerate-catalog.mjs: "543 adapters across 15 regions", and catalog.ts is unchanged.
  • packages/backend: npx jest src/adapters/intl/odoo.live.spec.ts gave 6 passed and 1 skipped (live gate).
  • packages/backend: npx eslint src/adapters/intl/odoo.live.spec.ts: clean.
  • packages/backend: npx jest src/adapters/catalog: 56 tests passed. Two suites (catalog.spec.ts, catalog-summary.spec.ts) failed to compile locally because the Prisma client wasn't generated in this environment (PrismaService has no $queryRaw / connector). That's an environment prerequisite, not caused by this change, and CI runs them after prisma generate.

Checklist

  • My code follows the existing code style
  • I have tested my changes locally
  • I have updated documentation (if applicable): the adapter instructions are the user-facing docs here
  • All existing tests pass (npm test): left to CI, see above
  • This PR has a descriptive title

Related Issues

None. Found in the daily review of failed tool calls.

res.partner has no mobile field on Odoo 19, yet agents keep asking for it
through odoo_search_read, odoo_read and odoo_create, and every such call
fails with Invalid field 'mobile' on 'res.partner'. The JSON-RPC adapter
already carries this hint; the REST adapter, which is the Odoo 19 one,
did not.

Name the removed and renamed fields seen in production (mobile, title,
tax_id) in the instructions, point the fields and values parameters at
phone, and assert the hint in the static spec. The shipped partner
wrapper never requested mobile, so no default field list changes.
@helpcodeai
helpcodeai requested a review from D3nisty as a code owner October 23, 2026 15:14
@helpcodeai
helpcodeai enabled auto-merge (squash) October 23, 2026 15:21
@helpcodeai
helpcodeai merged commit c4ac15b into main Oct 23, 2026
14 checks passed
@helpcodeai
helpcodeai deleted the fix/odoo-rest-mobile-field branch October 23, 2026 15:30
@github-actions github-actions Bot locked and limited conversation to collaborators Oct 23, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant