From 7d968ec202ceccc6a009ec150747cc927273f841 Mon Sep 17 00:00:00 2001 From: Michael Kret <88898367+michael-radency@users.noreply.github.com> Date: Mon, 4 Jul 2022 11:48:38 +0300 Subject: [PATCH] fix(Odoo Node): Prevent possible issues with some custom fields (#3496) --- packages/nodes-base/nodes/Odoo/Odoo.node.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/packages/nodes-base/nodes/Odoo/Odoo.node.ts b/packages/nodes-base/nodes/Odoo/Odoo.node.ts index 0385d88a85..86ff95dbd0 100644 --- a/packages/nodes-base/nodes/Odoo/Odoo.node.ts +++ b/packages/nodes-base/nodes/Odoo/Odoo.node.ts @@ -118,11 +118,16 @@ export class Odoo implements INodeType { const userID = await odooGetUserID.call(this, db, username, password, url); const responce = await odooGetModelFields.call(this, db, userID, password, resource, url); - const options = Object.values(responce).map((field) => { const optionField = field as { [key: string]: string }; + let name = ''; + try { + name = capitalCase(optionField.name); + } catch (error) { + name = optionField.name; + } return { - name: capitalCase(optionField.name), + name, value: optionField.name, // nodelinter-ignore-next-line description: `name: ${optionField?.name}, type: ${optionField?.type} required: ${optionField?.required}`,