Update mail_activity.py
This commit is contained in:
parent
f459770466
commit
a3e6a37c1b
|
|
@ -11,7 +11,9 @@ class MailActivity(models.Model):
|
|||
activity_ids = super(MailActivity, self).create(values)
|
||||
for activity_id in activity_ids:
|
||||
# Build message content
|
||||
notification_body = re.sub(r'<[^>]+>', '', activity_id.note.replace('<br>', '\n'))
|
||||
# Ensure activity_id.note is valid and avoid errors
|
||||
note = activity_id.note or ''
|
||||
notification_body = re.sub(r'<[^>]+>', '', note.replace('<br>', '\n'))
|
||||
|
||||
# Send notifications
|
||||
employee_id = self.env['hr.employee'].sudo().search([('user_id', '=', activity_id.user_id.id)])
|
||||
|
|
@ -20,4 +22,4 @@ class MailActivity(models.Model):
|
|||
"title": activity_id.summary or activity_id.create_uid.name,
|
||||
"body": notification_body
|
||||
})
|
||||
return activity_ids
|
||||
return activity_ids
|
||||
|
|
|
|||
Loading…
Reference in New Issue