[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:
@@ -2,7 +2,7 @@ import json
|
||||
import logging
|
||||
import urllib.request
|
||||
|
||||
from odoo import fields, models
|
||||
from odoo import _, fields, models
|
||||
|
||||
_logger = logging.getLogger(__name__)
|
||||
|
||||
@@ -100,8 +100,8 @@ class DocusealTemplate(models.Model):
|
||||
"type": "ir.actions.client",
|
||||
"tag": "display_notification",
|
||||
"params": {
|
||||
"title": "Action created",
|
||||
"message": "Contextual action created on res.partner.",
|
||||
"title": _("Action created"),
|
||||
"message": _("Contextual action created on res.partner."),
|
||||
"type": "success",
|
||||
},
|
||||
}
|
||||
@@ -112,6 +112,12 @@ class DocusealTemplate(models.Model):
|
||||
self.server_action_id.unlink()
|
||||
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):
|
||||
"""Create pre-filled submissions without sending the signature request
|
||||
email: the submission must then be sent from Docuseal."""
|
||||
|
||||
Reference in New Issue
Block a user