Hi, getting opcode errors in Odoo Studio V18.0, when using "execute Code" within the Contact model, on save; code: "
# Search for the document template (Make sure the name is correct or use XML ID)
template = env['sign.template'].search([('name', '=', 'Mixbean Non-Disclosure Agreement')], limit=1)
if not template:
raise UserError("Document template not found.")
# Create a signature request using the template
sign_request = env['sign.request'].create({
'template_id': record.id, # Contact is the signatory
'email': record.email, # Email for sending the document
})]
# Send the document for signing
sign_request.action_sent()
"
Thanks for all your insights