Merge pull request #1470 from automatisch/aut-538
fix(odoo): introduce secure connection option
This commit is contained in:
@@ -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,
|
||||
|
@@ -32,8 +32,10 @@ export const asyncMethodCall = async <T = number>($: 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,
|
||||
|
Reference in New Issue
Block a user