How to add mail template to already existed inbuilt button in odoo time off. odoov15.
class res_partner(models.Model):
_inherit = 'hr.leave'
def action_validate(self):
template_id = self.env.ref('iwave_time_off.leave_approval_mail').id
print(template_id, '==============================================')
template = self.env['mail.template'].browse(template_id)
template.send_mail(self.id, force_send=True)
self.write({'state': 'validate'})
return True
after inheriting this code timesheet doesnt display time off.
please help me to solve this error.