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)