[FIX] docuseal_signing: clean up server action and translate notifications
- Deleting a ``docuseal.template`` now removes its generated contextual server action; an orphaned action would browse a deleted template at runtime and crash. - The display notification strings are wrapped in ``_()`` so they are translatable, with their French translations in the catalog. - Add a short manifest description so the Apps page renders plain text instead of parsing the markdown README as reStructuredText. Covered by a unit test on the template deletion lifecycle. Assisted-By: GLM-5.3-Flash
This commit is contained in:
@@ -10,6 +10,10 @@
|
|||||||
"license": "AGPL-3",
|
"license": "AGPL-3",
|
||||||
"category": "",
|
"category": "",
|
||||||
"summary": "Electronic signature integration via Docuseal",
|
"summary": "Electronic signature integration via Docuseal",
|
||||||
|
"description": "Electronic signature integration between Odoo and a "
|
||||||
|
"Docuseal instance: configure signature templates in Odoo, pre-fill "
|
||||||
|
"them with contact data and request signatures from partners in a "
|
||||||
|
"few clicks.",
|
||||||
"depends": [
|
"depends": [
|
||||||
"base",
|
"base",
|
||||||
"base_setup",
|
"base_setup",
|
||||||
|
|||||||
@@ -6,8 +6,8 @@ msgid ""
|
|||||||
msgstr ""
|
msgstr ""
|
||||||
"Project-Id-Version: Odoo Server 18.0\n"
|
"Project-Id-Version: Odoo Server 18.0\n"
|
||||||
"Report-Msgid-Bugs-To: \n"
|
"Report-Msgid-Bugs-To: \n"
|
||||||
"POT-Creation-Date: 2026-11-03 15:44+0000\n"
|
"POT-Creation-Date: 2026-11-03 16:13+0000\n"
|
||||||
"PO-Revision-Date: 2026-11-03 15:44+0000\n"
|
"PO-Revision-Date: 2026-11-03 16:13+0000\n"
|
||||||
"Last-Translator: \n"
|
"Last-Translator: \n"
|
||||||
"Language-Team: \n"
|
"Language-Team: \n"
|
||||||
"MIME-Version: 1.0\n"
|
"MIME-Version: 1.0\n"
|
||||||
@@ -25,6 +25,12 @@ msgstr "URL de l'API"
|
|||||||
msgid "API token"
|
msgid "API token"
|
||||||
msgstr "Token API"
|
msgstr "Token API"
|
||||||
|
|
||||||
|
#. module: docuseal_signing
|
||||||
|
#. odoo-python
|
||||||
|
#: code:addons/docuseal_signing/models/docuseal_template.py:0
|
||||||
|
msgid "Action created"
|
||||||
|
msgstr "Action créée"
|
||||||
|
|
||||||
#. module: docuseal_signing
|
#. module: docuseal_signing
|
||||||
#: model_terms:ir.ui.view,arch_db:docuseal_signing.res_config_settings_view_form_docuseal
|
#: model_terms:ir.ui.view,arch_db:docuseal_signing.res_config_settings_view_form_docuseal
|
||||||
msgid "Authentication token (X-Auth-Token header)"
|
msgid "Authentication token (X-Auth-Token header)"
|
||||||
@@ -50,6 +56,12 @@ msgstr "Configuration"
|
|||||||
msgid "Configure templates"
|
msgid "Configure templates"
|
||||||
msgstr "Configurer les templates"
|
msgstr "Configurer les templates"
|
||||||
|
|
||||||
|
#. module: docuseal_signing
|
||||||
|
#. odoo-python
|
||||||
|
#: code:addons/docuseal_signing/models/docuseal_template.py:0
|
||||||
|
msgid "Contextual action created on res.partner."
|
||||||
|
msgstr "Action contextuelle créée sur les contacts."
|
||||||
|
|
||||||
#. module: docuseal_signing
|
#. module: docuseal_signing
|
||||||
#: model_terms:ir.ui.view,arch_db:docuseal_signing.docuseal_template_view_form
|
#: model_terms:ir.ui.view,arch_db:docuseal_signing.docuseal_template_view_form
|
||||||
msgid "Create contextual action"
|
msgid "Create contextual action"
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import json
|
|||||||
import logging
|
import logging
|
||||||
import urllib.request
|
import urllib.request
|
||||||
|
|
||||||
from odoo import fields, models
|
from odoo import _, fields, models
|
||||||
|
|
||||||
_logger = logging.getLogger(__name__)
|
_logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
@@ -100,8 +100,8 @@ class DocusealTemplate(models.Model):
|
|||||||
"type": "ir.actions.client",
|
"type": "ir.actions.client",
|
||||||
"tag": "display_notification",
|
"tag": "display_notification",
|
||||||
"params": {
|
"params": {
|
||||||
"title": "Action created",
|
"title": _("Action created"),
|
||||||
"message": "Contextual action created on res.partner.",
|
"message": _("Contextual action created on res.partner."),
|
||||||
"type": "success",
|
"type": "success",
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
@@ -112,6 +112,12 @@ class DocusealTemplate(models.Model):
|
|||||||
self.server_action_id.unlink()
|
self.server_action_id.unlink()
|
||||||
self.server_action_id = False
|
self.server_action_id = False
|
||||||
|
|
||||||
|
def unlink(self):
|
||||||
|
# Remove the generated contextual action: an action left behind
|
||||||
|
# would browse a deleted template at runtime.
|
||||||
|
self.mapped("server_action_id").unlink()
|
||||||
|
return super().unlink()
|
||||||
|
|
||||||
def _create_draft_submissions(self, partners):
|
def _create_draft_submissions(self, partners):
|
||||||
"""Create pre-filled submissions without sending the signature request
|
"""Create pre-filled submissions without sending the signature request
|
||||||
email: the submission must then be sent from Docuseal."""
|
email: the submission must then be sent from Docuseal."""
|
||||||
|
|||||||
@@ -1 +1,2 @@
|
|||||||
from . import test_fetch_fields
|
from . import test_fetch_fields
|
||||||
|
from . import test_server_action
|
||||||
|
|||||||
19
docuseal_signing/tests/test_server_action.py
Normal file
19
docuseal_signing/tests/test_server_action.py
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
from odoo.tests import TransactionCase
|
||||||
|
|
||||||
|
|
||||||
|
class TestServerAction(TransactionCase):
|
||||||
|
"""Lifecycle of the generated contextual server action."""
|
||||||
|
|
||||||
|
def test_unlink_removes_server_action(self):
|
||||||
|
"""Deleting a template removes its generated server action,
|
||||||
|
instead of leaving an orphaned action browsing a dead record."""
|
||||||
|
template = self.env["docuseal.template"].create({
|
||||||
|
"name": "Contract",
|
||||||
|
"template_id": 123,
|
||||||
|
})
|
||||||
|
template.action_create_server_action()
|
||||||
|
action = template.server_action_id
|
||||||
|
self.assertTrue(action.exists())
|
||||||
|
|
||||||
|
template.unlink()
|
||||||
|
self.assertFalse(action.exists())
|
||||||
Reference in New Issue
Block a user