diff --git a/docuseal_signing/README.md b/docuseal_signing/README.md new file mode 100644 index 0000000..db9a4fb --- /dev/null +++ b/docuseal_signing/README.md @@ -0,0 +1,92 @@ +# Docuseal Signing + +Electronic signature integration between Odoo and a +[Docuseal](https://www.docuseal.com/) instance: configure signature +templates in Odoo, pre-fill them with contact data and request +signatures from partners in a few clicks. + +## Features + +- **Template registry** (`docuseal.template`): reference Docuseal + templates by their ID and submitter role, and fetch their field list + from the Docuseal API with a single click. +- **Field mapping** (`docuseal.template.field`): map each Docuseal + field to a `res.partner` field. Values are pre-filled at submission + time and locked so the signer cannot change them (empty mappings stay + editable by the signer). +- **One-click signature request**: generate a server action bound to + `res.partner` (contextual *Action* menu entry) that creates a Docuseal + submission for the selected contacts and emails them the signature + request. A draft mode (`_create_draft_submissions`) creates the + pre-filled submission without sending the email, so it can be sent + from Docuseal. +- **Settings**: configure the Docuseal API URL and API token in + *Settings → General Settings* (system parameters + `docuseal.api_url` and `docuseal.api_token`). + +## Installation + +- Requires Odoo 18.0. +- Depends only on `base` and `base_setup`; no extra Python package + (API calls use the standard library). +- A reachable Docuseal instance with an API token is needed at runtime. + +## Technical usage + +The module adds two methods for developers and server actions. + +### Request a signature from code + +```python +template = self.env["docuseal.template"].search( + [("template_id", "=", 12345)], limit=1 +) +partners = self.env["res.partner"].browse([42, 43]) + +# Create a submission per partner and let Docuseal email the +# signature request: +results = template._create_submissions(partners) + +# Or create pre-filled drafts without sending the email: the +# submission must then be sent from Docuseal. +template._create_draft_submissions(partners) +``` + +Behavior of both calls: + +- One Docuseal submission is created per partner, using the template's + Docuseal `template_id` and `submitter_role`; the partner's `name` + and `email` identify the submitter. +- Each mapped Docuseal field is pre-filled from the partner field set + in `docuseal.template.field`. Non-empty values are locked + (`readonly=True`) so the signer cannot change them; empty values + stay editable. +- Date values are formatted as `%d/%m/%Y`, many2one/many2many values + as a comma-joined list of display names, and selection values as + their human-readable label. +- Both methods return the list of Docuseal API responses (one dict per + submission); errors bubble up as exceptions if the API call fails. + +### From a server action + +The generated contextual action calls the same entry point on the +selected records: + +```python +env['docuseal.template'].browse()._create_submissions(records) +``` + +### Configuration + +Both methods read the API credentials from system parameters +(`ir.config_parameter`): + +- `docuseal.api_token` — the Docuseal API token (required), set in + *Settings → General Settings*. +- `docuseal.api_url` — the Docuseal instance base URL, defaulting to + `https://sign.elabore.coop`. + +## Credits + +- **Contributors**: Quentin Mondot +- **Maintainer**: [Elabore](https://elabore.coop) diff --git a/docuseal_signing/i18n/fr_CH.po b/docuseal_signing/i18n/fr_CH.po deleted file mode 100644 index a762dec..0000000 --- a/docuseal_signing/i18n/fr_CH.po +++ /dev/null @@ -1,210 +0,0 @@ -# Translation of Odoo Server. -# This file contains the translation of the following modules: -# * docuseal_signing -# -msgid "" -msgstr "" -"Project-Id-Version: Odoo Server 18.0\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2026-05-19 16:22+0000\n" -"PO-Revision-Date: 2026-05-19 16:22+0000\n" -"Last-Translator: \n" -"Language-Team: \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: \n" -"Plural-Forms: \n" - -#. module: docuseal_signing -#: model_terms:ir.ui.view,arch_db:docuseal_signing.res_config_settings_view_form_docuseal -msgid "API URL" -msgstr "URL de l'API" - -#. module: docuseal_signing -#: model_terms:ir.ui.view,arch_db:docuseal_signing.res_config_settings_view_form_docuseal -msgid "API token" -msgstr "Token API" - -#. module: docuseal_signing -#: model_terms:ir.ui.view,arch_db:docuseal_signing.res_config_settings_view_form_docuseal -msgid "Authentication token (X-Auth-Token header)" -msgstr "Token d'authentification (en-tête X-Auth-Token)" - -#. module: docuseal_signing -#: model_terms:ir.ui.view,arch_db:docuseal_signing.res_config_settings_view_form_docuseal -msgid "Base URL of the Docuseal instance (e.g. https://sign.elabore.coop)" -msgstr "URL de base de l'instance Docuseal (ex : https://sign.elabore.coop)" - -#. module: docuseal_signing -#: model:ir.model,name:docuseal_signing.model_res_config_settings -msgid "Config Settings" -msgstr "Paramètres de configuration" - -#. module: docuseal_signing -#: model_terms:ir.ui.view,arch_db:docuseal_signing.res_config_settings_view_form_docuseal -msgid "Configuration" -msgstr "Configuration" - -#. module: docuseal_signing -#: model_terms:ir.ui.view,arch_db:docuseal_signing.res_config_settings_view_form_docuseal -msgid "Configure templates" -msgstr "Configurer les templates" - -#. module: docuseal_signing -#: model_terms:ir.ui.view,arch_db:docuseal_signing.docuseal_template_view_form -msgid "Create contextual action" -msgstr "Créer l'action contextuelle" - -#. module: docuseal_signing -#: model:ir.model.fields,field_description:docuseal_signing.field_docuseal_template__create_uid -#: model:ir.model.fields,field_description:docuseal_signing.field_docuseal_template_field__create_uid -msgid "Created by" -msgstr "Créé par" - -#. module: docuseal_signing -#: model:ir.model.fields,field_description:docuseal_signing.field_docuseal_template__create_date -#: model:ir.model.fields,field_description:docuseal_signing.field_docuseal_template_field__create_date -msgid "Created on" -msgstr "Créé le" - -#. module: docuseal_signing -#: model_terms:ir.ui.view,arch_db:docuseal_signing.res_config_settings_view_form_docuseal -msgid "Define field mappings and generate contextual actions on contacts" -msgstr "Définir les correspondances de champs et générer les actions contextuelles sur les contacts" - -#. module: docuseal_signing -#: model_terms:ir.ui.view,arch_db:docuseal_signing.docuseal_template_view_form -msgid "Delete contextual action" -msgstr "Supprimer l'action contextuelle" - -#. module: docuseal_signing -#: model_terms:ir.ui.view,arch_db:docuseal_signing.docuseal_template_view_form -msgid "" -"Delete the contextual action? It will no longer appear in the Action menu on" -" contacts." -msgstr "" -"Supprimer l'action contextuelle ? Elle n'apparaîtra plus dans le menu Action" -" des contacts." - -#. module: docuseal_signing -#: model:ir.model.fields,field_description:docuseal_signing.field_docuseal_template__display_name -#: model:ir.model.fields,field_description:docuseal_signing.field_docuseal_template_field__display_name -msgid "Display Name" -msgstr "Nom affiché" - -#. module: docuseal_signing -#: model:ir.model.fields,field_description:docuseal_signing.field_res_config_settings__docuseal_api_url -msgid "Docuseal API URL" -msgstr "URL de l'API Docuseal" - -#. module: docuseal_signing -#: model:ir.model.fields,field_description:docuseal_signing.field_res_config_settings__docuseal_api_token -msgid "Docuseal API token" -msgstr "Token API Docuseal" - -#. module: docuseal_signing -#: model:ir.model,name:docuseal_signing.model_docuseal_template -msgid "Docuseal Template" -msgstr "Template Docuseal" - -#. module: docuseal_signing -#: model:ir.model,name:docuseal_signing.model_docuseal_template_field -msgid "Docuseal Template Field" -msgstr "Champ de template Docuseal" - -#. module: docuseal_signing -#: model:ir.model.fields,field_description:docuseal_signing.field_docuseal_template_field__docuseal_field_name -msgid "Docuseal field" -msgstr "Champ Docuseal" - -#. module: docuseal_signing -#: model_terms:ir.ui.view,arch_db:docuseal_signing.res_config_settings_view_form_docuseal -msgid "Docuseal signing" -msgstr "Signature Docuseal" - -#. module: docuseal_signing -#: model_terms:ir.ui.view,arch_db:docuseal_signing.docuseal_template_view_form -msgid "Docuseal template" -msgstr "Template Docuseal" - -#. module: docuseal_signing -#: model:ir.actions.act_window,name:docuseal_signing.docuseal_template_action -#: model_terms:ir.ui.view,arch_db:docuseal_signing.docuseal_template_view_list -#: model_terms:ir.ui.view,arch_db:docuseal_signing.res_config_settings_view_form_docuseal -msgid "Docuseal templates" -msgstr "Templates Docuseal" - -#. module: docuseal_signing -#: model_terms:ir.ui.view,arch_db:docuseal_signing.docuseal_template_view_form -msgid "Fetch template fields" -msgstr "Rapatrier les champs du template" - -#. module: docuseal_signing -#: model_terms:ir.ui.view,arch_db:docuseal_signing.docuseal_template_view_form -msgid "Field mapping" -msgstr "Correspondance des champs" - -#. module: docuseal_signing -#: model:ir.model.fields,field_description:docuseal_signing.field_docuseal_template__field_ids -msgid "Fields" -msgstr "Champs" - -#. module: docuseal_signing -#: model:ir.model.fields,field_description:docuseal_signing.field_docuseal_template__id -#: model:ir.model.fields,field_description:docuseal_signing.field_docuseal_template_field__id -msgid "ID" -msgstr "ID" - -#. module: docuseal_signing -#: model:ir.model.fields,field_description:docuseal_signing.field_docuseal_template__write_uid -#: model:ir.model.fields,field_description:docuseal_signing.field_docuseal_template_field__write_uid -msgid "Last Updated by" -msgstr "Dernière mise à jour par" - -#. module: docuseal_signing -#: model:ir.model.fields,field_description:docuseal_signing.field_docuseal_template__write_date -#: model:ir.model.fields,field_description:docuseal_signing.field_docuseal_template_field__write_date -msgid "Last Updated on" -msgstr "Dernière mise à jour le" - -#. module: docuseal_signing -#: model_terms:ir.ui.view,arch_db:docuseal_signing.res_config_settings_view_form_docuseal -msgid "Manage Docuseal templates" -msgstr "Gérer les templates Docuseal" - -#. module: docuseal_signing -#: model:ir.model.fields,field_description:docuseal_signing.field_docuseal_template__name -msgid "Name" -msgstr "Nom" - -#. module: docuseal_signing -#: model:ir.model.fields,field_description:docuseal_signing.field_docuseal_template__server_action_id -msgid "Server action" -msgstr "Action serveur" - -#. module: docuseal_signing -#: model:ir.model.fields,field_description:docuseal_signing.field_docuseal_template__smart_search -#: model:ir.model.fields,field_description:docuseal_signing.field_docuseal_template_field__smart_search -#: model:ir.model.fields,field_description:docuseal_signing.field_res_config_settings__smart_search -msgid "Smart Search" -msgstr "Recherche intelligente" - -#. module: docuseal_signing -#: model:ir.model.fields,field_description:docuseal_signing.field_docuseal_template__submitter_role -msgid "Submitter role" -msgstr "Rôle du signataire" - -#. module: docuseal_signing -#: model:ir.model.fields,field_description:docuseal_signing.field_docuseal_template_field__template_id -msgid "Template" -msgstr "Template" - -#. module: docuseal_signing -#: model:ir.model.fields,field_description:docuseal_signing.field_docuseal_template__template_id -msgid "Template ID" -msgstr "ID du template" - -#. module: docuseal_signing -#: model:ir.model.fields,field_description:docuseal_signing.field_docuseal_template_field__partner_field_id -msgid "res.partner field" -msgstr "Champ res.partner" diff --git a/docuseal_signing/models/__init__.py b/docuseal_signing/models/__init__.py index 5c35c4a..406be02 100644 --- a/docuseal_signing/models/__init__.py +++ b/docuseal_signing/models/__init__.py @@ -1,4 +1,3 @@ from . import docuseal_template from . import docuseal_template_field from . import res_config_settings -from . import res_partner diff --git a/docuseal_signing/models/res_partner.py b/docuseal_signing/models/res_partner.py deleted file mode 100644 index 0de0fa1..0000000 --- a/docuseal_signing/models/res_partner.py +++ /dev/null @@ -1,21 +0,0 @@ -import logging - -from odoo import models - -_logger = logging.getLogger(__name__) - - -class ResPartner(models.Model): - _inherit = "res.partner" - - def request_docuseal_signature(self, docuseal_template_id): - template = self.env["docuseal.template"].search( - [("template_id", "=", docuseal_template_id)], limit=1 - ) - if not template: - _logger.warning( - "Docuseal: no template configured in Odoo for template ID %s", - docuseal_template_id, - ) - return - template._create_submissions(self)