Repository navigation
Steer the Odoo REST adapter away from fields Odoo 19 removed - #1215
Merged
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
On Odoo 19
res.partnerhas nomobilefield, but agents using the Odoo (REST, JSON-2) connector keep asking for it. Every such call fails withInvalid 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:
fieldsinodoo_search_read(87) andodoo_read(4),valuesinodoo_create(4), and a few domains that filter onmobile. The shippedodoo_list_partnersfield list never includedmobile, so no default list needed changing.Changes
mobile(usephone) andtitleon res.partner, plustax_id→tax_idson sale.order.line. All three show up in production errors on this adapter, andtax_idssucceeds 239 times. It also says to checkodoo_fields_getafter anInvalid fielderror rather than repeat the call.fieldsonodoo_search_read/odoo_read: ask forphone, notmobile, on res.partner.valuesonodoo_create/odoo_write: put any phone number inphone.mobile.catalog.tsdoesn't change: the adapter JSON is imported, and the version is a content hash.Type
Cloud and self-hosted
Same in both modes: these are description-only changes. On boot,
CatalogReconcilerapplies 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 unlessCATALOG_AUTOSYNC=false.Testing
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 forintl/odoo.json.node scripts/regenerate-catalog.mjs: "543 adapters across 15 regions", andcatalog.tsis unchanged.packages/backend:npx jest src/adapters/intl/odoo.live.spec.tsgave 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 (PrismaServicehas no$queryRaw/connector). That's an environment prerequisite, not caused by this change, and CI runs them afterprisma generate.Checklist
npm test): left to CI, see aboveRelated Issues
None. Found in the daily review of failed tool calls.