Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions packages/backend/src/adapters/intl/odoo-jsonrpc.json
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@
},
"domain": {
"type": "array",
"description": "Extra Odoo domain, e.g. [[\"customer_rank\",\">\",0]] for customers only.",
"description": "Extra Odoo domain, e.g. [[\"customer_rank\",\">\",0]] for customers only. customer_rank and supplier_rank exist only when the Invoicing app is installed; without it that domain fails with Invalid field.",
"items": {
"type": "array"
},
Expand All @@ -255,7 +255,7 @@
"endpointMapping": {
"method": "POST",
"path": "/jsonrpc",
"bodyTemplate": "{\"jsonrpc\":\"2.0\",\"method\":\"call\",\"id\":1,\"params\":{\"service\":\"object\",\"method\":\"execute_kw\",\"args\":[\"{{ODOO_DB}}\",{{ODOO_UID}},\"{{ODOO_API_KEY}}\",\"res.partner\",\"search_read\",[${domain}],{\"fields\":[\"id\", \"name\", \"email\", \"phone\", \"city\", \"country_id\", \"customer_rank\", \"supplier_rank\", \"vat\"],\"limit\":${limit},\"offset\":${offset},\"order\":\"name asc\"}]}}"
"bodyTemplate": "{\"jsonrpc\":\"2.0\",\"method\":\"call\",\"id\":1,\"params\":{\"service\":\"object\",\"method\":\"execute_kw\",\"args\":[\"{{ODOO_DB}}\",{{ODOO_UID}},\"{{ODOO_API_KEY}}\",\"res.partner\",\"search_read\",[${domain}],{\"fields\":[\"id\", \"name\", \"email\", \"phone\", \"city\", \"country_id\", \"vat\"],\"limit\":${limit},\"offset\":${offset},\"order\":\"name asc\"}]}}"
},
"annotations": {
"readOnlyHint": true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,10 @@ describe('odoo-jsonrpc adapter: static spec conformance', () => {
it('checks the connection on a path every Odoo version serves', () => {
expect(a.connector.healthcheckPath).toBe('/web/health');
});

it('reads partners with fields every Odoo has, since the setup check calls this tool', () => {
const partners = a.tools.find((t) => t.name === 'odoo_list_partners');
// customer_rank / supplier_rank come with the Invoicing app only.
expect(partners?.endpointMapping.bodyTemplate).not.toMatch(/customer_rank|supplier_rank/);
});
});
4 changes: 1 addition & 3 deletions packages/backend/src/adapters/intl/odoo.json
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@
},
"domain": {
"type": "array",
"description": "Extra Odoo domain, e.g. [[\"customer_rank\",\">\",0]] for customers only.",
"description": "Extra Odoo domain, e.g. [[\"customer_rank\",\">\",0]] for customers only. customer_rank and supplier_rank exist only when the Invoicing app is installed; without it that domain fails with Invalid field.",
"items": {
"type": "array"
}
Expand All @@ -245,8 +245,6 @@
"phone",
"city",
"country_id",
"customer_rank",
"supplier_rank",
"vat"
],
"limit": "$limit",
Expand Down
3 changes: 3 additions & 0 deletions packages/backend/src/adapters/intl/odoo.live.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ describe('odoo adapter — static spec conformance', () => {
// The partner wrapper's fixed field list must work on Odoo 19 as shipped.
const partners = tools.find((t) => t.name === 'odoo_list_partners');
expect(JSON.stringify(partners?.endpointMapping)).not.toContain('"mobile"');
// customer_rank / supplier_rank come with the Invoicing app: an Odoo
// without it answers the setup check (this tool) with Invalid field.
expect(JSON.stringify(partners?.endpointMapping)).not.toMatch(/customer_rank|supplier_rank/);
});

it("tells call_method to pass required arguments by name and one id for singleton actions", () => {
Expand Down
Loading