feat(odoo): add auth and create lead action (#1143)

* Add Odoo App and Icon

* Add Auth for Odoo

* Authorise with API key, the password would also work, but we should encourage an API key.

* Odoo Verify Credentials method

* Add the xmlrpc dependency so the backend can communicate with Odoo's API.
* Add a port to the auth fields to establish a connection that might not be over HTTPS.

* Add still verified method

* Currently no need to keep uid, so remove it from the auth data.
* Await the callback from the xmlrpc method call to ensure we don't verify credentials before the callback has been executed.

* Add Odoo create-lead action

* Provide basic functionality to create a lead.

* Add Odoo type option

* Let the user decide if the lead should be a "lead" or "opportunity" in the create-lead action.

* Add documentation for Odoo app

* Follow project standards

* Change indents to 2 spaces
* Use single quotes instead of double

* Commonise the authentication method (DRY)

* Use latest for API doc link

* refactor(odoo): abstract and organize implementation

---------

Co-authored-by: Ali BARIN <ali.barin53@gmail.com>
This commit is contained in:
Jack Dane
2023-06-29 14:56:20 +01:00
committed by GitHub
parent 8e9896ec2e
commit 807be59f25
15 changed files with 343 additions and 2 deletions

View File

@@ -0,0 +1,12 @@
---
favicon: /favicons/odoo.svg
items:
- name: Create a lead or opportunity
desc: Creates a new CRM record as a lead or opportunity.
---
<script setup>
import CustomListing from '../../components/CustomListing.vue'
</script>
<CustomListing />

View File

@@ -0,0 +1,16 @@
# Odoo
:::info
This page explains the steps you need to follow to set up the Odoo
connection in Automatisch. If any of the steps are outdated, please let us know!
:::
To create a connection, you need to supply the following information:
1. Fill the **Host Name** field with the Odoo host.
1. Fill the **Port** field with the Odoo port.
1. Fill the **Database Name** field with the Odoo database.
1. Fill the **Email Address** field with the email address of the account that will be intereacting with the database.
1. Fill the **API Key** field with the API key for your Odoo account.
Odoo's [API documentation](https://www.odoo.com/documentation/latest/developer/reference/external_api.html#api-keys) explains how to create API keys.