Skip to content

Commit

Permalink
fix(Odoo Node): Prevent possible issues with some custom fields (#3496)
Browse files Browse the repository at this point in the history
  • Loading branch information
michael-radency committed Jul 4, 2022
1 parent 224e008 commit 7d968ec
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions packages/nodes-base/nodes/Odoo/Odoo.node.ts
Expand Up @@ -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}`,
Expand Down

0 comments on commit 7d968ec

Please sign in to comment.