Questions about the Odoo adaptor

Hey @jclark @mtuchi - A developer @rickettspc is working with sent over these questions about the odoo adaptor.

Firstly, this odoo adaptor repo looks old (from 2017). Should it be moved over to the main OpenFn adaptors repo?

Then, when you get a moment - can you please answer these questions from the developer?

  1. Where exactly is the language-odoo module assumed to be sitting? In a server, on the client side, inbetween?

  2. Which Odoo version does language-odoo code work for? Is it only 10.0, or does it work all the way up to 16 and 17?

  3. There is code that says

return state => {
...
const { username, database, hostUrl, password, port } = state.configuration;
...
}

Exactly what is “state=> { … }” and “state.configuration” referring to?

  1. What benefits does using this library have over using the External or Extract Odoo APIs from Odoo 17? Or is it convenient like the IndexDB wrapper libraries, or is it because JavaScript is an unsupported language?

Thanks!

Hello @rickettspc :wave: . Here is the quick breakdown of the questions you asked

1. Where exactly is the language-odoo module assumed to be sitting? In a server, on the client side, in-between?

language-odoo module will stay in OpenFn server. Read more about OpenFn Adaptors on docs: Adaptors | OpenFn/docs

In more details language-odoo is an older version of of the OpenFn Adaptors. Adaptors are open-source Javascript or Typescript modules integrated into the OpenFn platform to provide users with clean set of helper functions that help communicate with a specific external system. When you configure a data integration flow in OpenFn, you would specify the relevant adaptors for the systems you're connecting to.

2. Which Odoo version does language-odoo code work for? Is it only 10.0, or does it work all the way up to 16 and 17?

Our odoo adaptor was using an old client, which has not been update for 7 years. We do not know which version of Odoo was supported. I think we would need to create a new adaptor from scratch if you want to integrate with Odoo, or leverage the generic HTTP Adaptor to connect with the Odoo REST API.

  1. what is state?
    I think it’s important to understand OpenFn concepts and for that I recommend you go through the following documentation
  1. Benefits of using Odoo adaptor
    OpenFn is a web app that’s used by our customers (mostly SaaS) to create and execute untrusted Javascript code in little NodeJs VMs with some extra security/sandboxing features. So we make use of pure Javascript drivers for our adaptors to provide users with a clean set of helper functions that help communicate with a specific external system. While workflows vary from project to project, OpenFn Adaptors are reusable, open source components and whenever enhancements are made to them, they drive down the cost of all future implementations for a given source or target system. You can write a bunch of bespoke integration scripts to connect different apps, or you can leverage OpenFn adaptors to more quickly write scripts, configure and manage automated workflows.

Thanks

@rickettspc Building on Mtuchi’s answer, it sounds like your developer is searching for a general understanding of Adaptors and how they work, so I agree with Mtuchi that they should check out OpenFn Docs and this overview of OpenFn design basics. We’d also be happy to schedule a call to walk through this in further detail.

For connecting with Odoo, as Mtuchi mentioned - you can use the http adaptor to connect with Odoo’s APIs (this will work out-of-the-box with any REST API), or we can explore creating a new OpenFn adaptor for Odoo using existing templates. In our experience, the best Adaptors are developed alongside a workflow implementation - so that you can test the new adaptor functions as you implement the workflow requirements.

1 Like

Hi Mtuchi,

Thanks for your quick response, you’ve covered all questions perfectly

Hi Aleksa,

You are right, the dev is new to OpenFN, and this is more of an exploratory engagement for him at this point.

We do have a potential implementation so I will reach out to you

hi @mtuchi , I read your answer here, and having something to ask…
I am currently developing an adaptor for my company, and I can test it via openfn-cli. That’s nice, but what if I want to see how it runs in Lightning instance before my PR is merged into adaptor repo? [let say I already boosted up Lightning in my local environment, what do I have to change in Lightning code so that it can install runtime adaptor from my GitHub repo together with adaptors from OpenFn npm?]

sorry, I am so green when it comes to elixir programming language & phoenix framework

Hello @nhatnm0612 , Unfortunately there’s not currently any way to import a local adaptor into Lightning

We’d love to know more about why you want to do this! Do you expect the adaptor to behave differently in Lightning? Or is there something in the Lightning integration you particularly want to see?

for the reason, I just want to do demo for my company before everything was merged. CLI is good, but for non-tech people, it’s stressful, truly.

Ok, we understand! Thank you for explaining.

We’ll look into it but it’ll be a while before we can support this from lightning. In meantime you’ll have to demo from the latest release (and your 1.2.0 adaptor release is imminent!)