[IMP] docuseal_signing : function request_docuseal_signature on res.partner model

This commit is contained in:
2026-05-20 09:38:14 +02:00
parent 20099e1c78
commit aecef0daea
2 changed files with 22 additions and 0 deletions

View File

@@ -1,3 +1,4 @@
from . import docuseal_template
from . import docuseal_template_field
from . import res_config_settings
from . import res_partner

View File

@@ -0,0 +1,21 @@
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)