with Odoo and Talend?
List all plan executions the user is granted visibility on. For each plan execution returns execution and plan identifiers, start and finish timestamps, execution status and counters on done and planned executables within plan. See the documentation
Get detailed status of one plan execution. See the documentation
import xmlrpc from 'xmlrpc';
export default defineComponent({
props: {
odoo: {
type: "app",
app: "odoo",
}
},
async run({ steps, $ }) {
const url = this.odoo.$auth.server_url;
const db = this.odoo.$auth.db;
const username = this.odoo.$auth.username;
const password = this.odoo.$auth.password;
// Create clients for common and object endpoints
const common = xmlrpc.createSecureClient(`${url}/xmlrpc/2/common`);
const models = xmlrpc.createSecureClient(`${url}/xmlrpc/2/object`);
// Using async/await with promises
async function getFields() {
try {
// Authenticate and get uid
const uid = await new Promise((resolve, reject) => {
common.methodCall('authenticate', [db, username, password, {}], (error, value) => {
if (error) reject(error);
resolve(value);
});
});
// Get fields
const results = await new Promise((resolve, reject) => {
models.methodCall('execute_kw', [
db,
uid,
password,
'res.partner',
'fields_get',
[],
{ 'attributes': ['string', 'help', 'type'] }
], (error, value) => {
if (error) reject(error);
resolve(value);
});
});
return results;
} catch (error) {
throw new Error(error);
}
}
return await getFields();
},
})
The Talend API provides a robust toolkit for data integration and management, enabling the automation of tasks such as data extraction, transformation, and loading (ETL). By leveraging the Talend API within Pipedream, you can create intricate workflows that automate data operations, integrate with various data sources, and orchestrate data pipelines. It's a tool designed for data professionals seeking to streamline data processes and ensure data quality across their systems.
import { axios } from "@pipedream/platform"
export default defineComponent({
props: {
talend: {
type: "app",
app: "talend",
}
},
async run({steps, $}) {
return await axios($, {
url: `https://api.${this.talend.$auth.endpoint}.cloud.talend.com/account/users`,
headers: {
Authorization: `Bearer ${this.talend.$auth.persona_access_token}`,
"Accept": `application/json`,
},
})
},
})