diff --git a/packages/backend/src/apps/odoo/auth/index.ts b/packages/backend/src/apps/odoo/auth/index.ts index 4a9b99e5..2362e232 100644 --- a/packages/backend/src/apps/odoo/auth/index.ts +++ b/packages/backend/src/apps/odoo/auth/index.ts @@ -11,7 +11,7 @@ export default { readOnly: false, value: null, placeholder: null, - description: 'Host name of your Odoo Server', + description: 'Host name of your Odoo Server (e.g. sub.domain.com without the protocol)', clickToCopy: false, }, { @@ -25,6 +25,27 @@ export default { description: 'Port that the host is running on, defaults to 443 (HTTPS)', clickToCopy: false, }, + { + key: 'secure', + label: 'Secure', + type: 'dropdown' as const, + required: true, + readOnly: false, + value: 'true', + description: 'True if the host communicates via secure protocol.', + variables: false, + clickToCopy: false, + options: [ + { + label: 'True', + value: 'true', + }, + { + label: 'False', + value: 'false', + }, + ], + }, { key: 'databaseName', label: 'Database Name', @@ -40,7 +61,7 @@ export default { key: 'email', label: 'Email Address', type: 'string' as const, - requires: true, + required: true, readOnly: false, value: null, placeholder: null, diff --git a/packages/backend/src/apps/odoo/common/xmlrpc-client.ts b/packages/backend/src/apps/odoo/common/xmlrpc-client.ts index a29dd374..595dce53 100644 --- a/packages/backend/src/apps/odoo/common/xmlrpc-client.ts +++ b/packages/backend/src/apps/odoo/common/xmlrpc-client.ts @@ -32,8 +32,10 @@ export const asyncMethodCall = async ($: IGlobalVariable, { method, export const getClient = ($: IGlobalVariable, { path = 'common' }) => { const host = $.auth.data.host as string; const port = Number($.auth.data.port as string); + const secure = $.auth.data.secure === 'true'; + const createClientFunction = secure ? xmlrpc.createSecureClient : xmlrpc.createClient; - return xmlrpc.createClient( + return createClientFunction( { host, port,