with Odoo and Project Bubble (ProProfs Project)?
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 Project Bubble (ProProfs Project) API offers a suite of project management tools that can help streamline workflows, improve collaboration, and track progress on tasks and milestones within a project. Using Pipedream, you can automate interactions between Project Bubble and other apps, create custom events based on project changes, and manage your projects efficiently. From syncing tasks with calendar apps to triggering notifications when project milestones are reached, the possibilities are vast for enhancing productivity and project oversight.
import { axios } from "@pipedream/platform"
export default defineComponent({
props: {
project_bubble: {
type: "app",
app: "project_bubble",
}
},
async run({steps, $}) {
return await axios($, {
url: `https://api.projectbubble.com/v2/user`,
headers: {
"key": `${this.project_bubble.$auth.api_key}`,
},
})
},
})