Skip to content

Commit 7d968ec

Browse files
fix(Odoo Node): Prevent possible issues with some custom fields (#3496)
1 parent 224e008 commit 7d968ec

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

packages/nodes-base/nodes/Odoo/Odoo.node.ts

+7-2
Original file line numberDiff line numberDiff line change
@@ -118,11 +118,16 @@ export class Odoo implements INodeType {
118118
const userID = await odooGetUserID.call(this, db, username, password, url);
119119

120120
const responce = await odooGetModelFields.call(this, db, userID, password, resource, url);
121-
122121
const options = Object.values(responce).map((field) => {
123122
const optionField = field as { [key: string]: string };
123+
let name = '';
124+
try {
125+
name = capitalCase(optionField.name);
126+
} catch (error) {
127+
name = optionField.name;
128+
}
124129
return {
125-
name: capitalCase(optionField.name),
130+
name,
126131
value: optionField.name,
127132
// nodelinter-ignore-next-line
128133
description: `name: ${optionField?.name}, type: ${optionField?.type} required: ${optionField?.required}`,

0 commit comments

Comments
 (0)