Ce guide n’est pas encore traduit dans votre langue.
This page explains how to install the LegalCloud module for Odoo. It works with Odoo 17.0 (Odoo 16 and 18 are not supported by this release), Python 3.10+ with requests, and needs the website and portal modules.
Before you start
You need:
- An Odoo instance where you can add custom modules to the
addonspath. - A LegalCloud account (create one at https://dash.legalcloud.info/auth/onboarding).
- An API token (Organization → API in the dashboard — see API tokens).
- The hash of the document you want to embed (the part after
/d/of its public address).
Step 1 — Download the module
- Sign in to your dashboard at https://dash.legalcloud.info/auth/login.
- Open Downloads.
- Download LegalCloud Documents for Odoo. The file is named
legalcloud_odoo-{version}.zip; the page shows its SHA-256 fingerprint.
Step 2 — Install the module
- Unzip the file. You get a folder named
legalcloud. - Copy that folder into an
addonsdirectory of your Odoo server (one that is listed inaddons_pathinodoo.conf). - Restart Odoo.
- Enable developer mode, go to Apps → Update Apps List and confirm.
- Search for LegalCloud Documents in Apps and click Install.
Installing the module creates a configuration record for each company with a unique plugin id, which LegalCloud uses to identify your Odoo instance in the analytics.
Step 3 — Configure the connection
Open LegalCloud → Configuration, select the configuration of your company and fill in:
| Field | Value |
|---|---|
| API Token | The token from your dashboard (only administrators see this field) |
| Site URL | The public URL of your Odoo website (sent in X-LegalCloud-Site) |
| LegalCloud API URL | https://api.legalcloud.info (default) |
| LegalCloud Pages URL | https://dash.legalcloud.info (default; origin of the public /d/{hash} pages) |
| Default Document Hash | The hash of the document to embed by default |
| Default Language | es, en, fr, de or it |
Click Test Connection. The test calls GET /api/documents/limits, so it needs an application token with the documents:read scope; a green "Connection successful" notice means the token is valid, and 401 / 403 messages tell you if the token is wrong or lacks the scope. Skip the test if you use a document token.
Each company has its own configuration (created on install, one per company), so a multi-company Odoo can use a different token for every company.
Step 4 — Register documents and embed them
Create a LegalCloud Document record in LegalCloud → Documents for every document you want to embed: a name, the document hash, the language and the height. Optionally link it to an Odoo record (source model and id). Every active document is also available as a ready-made public page at /legalcloud/document/<id>.
To embed it in a portal or website page, call the QWeb template legalcloud.legalcloud_iframe with the document:
<t t-call="legalcloud.legalcloud_iframe">
<t t-set="doc" t-value="request.env['legalcloud.document'].sudo().search([('name', '=', 'Privacy Policy')], limit=1)"/>
</t>
In a controller:
def my_page(self, **kw):
doc = request.env['legalcloud.document'].sudo().search([('name', '=', 'Privacy Policy')], limit=1)
return request.render('legalcloud.legalcloud_iframe', {'doc': doc})
To obtain just the address of the iframe:
config = request.env['legalcloud.config']._get_for_company()
url = config.get_iframe_url('abc123def456', lang='es')
The iframe address contains the API token. Use a document token (a token that can only open that document, see API tokens) as the API Token of the configuration when the embedded pages are public.
Updating the module
Download the new ZIP from Downloads, replace the legalcloud folder in your addons directory, restart Odoo and click Upgrade on the module in Apps (or run Odoo with -u legalcloud).
Uninstalling
In Apps, find LegalCloud Documents and click Uninstall. Your documents stay in LegalCloud.
Troubleshooting
"Connection failed: HTTP 401" or "HTTP 403"
401: the token is wrong, revoked or expired; create a new one in Organization → API. 403: the token does not have the documents:read scope.
"Connection error"
Check that your Odoo server can reach https://api.legalcloud.info and that its clock and TLS certificates are valid.
The iframe shows a configuration notice
The API token is not configured for the current company.