[FIX] odex_web_app: conflicts between 2 modules on user_push_notification function

This commit is contained in:
Samir Ladoui 2024-07-07 15:38:23 +01:00
parent 1baab971e3
commit 87c463c039
2 changed files with 3 additions and 3 deletions

View File

@ -14,7 +14,7 @@ class HrEmployee(models.Model):
fcm_token_web = fields.Char(string='FCM Web Token')
def user_push_notification(self, notification):
def user_push_notification_web(self, notification):
url = "https://fcm.googleapis.com/fcm/send"
header = {
'Content-Type': 'application/json',

View File

@ -15,7 +15,7 @@ class MailThread(models.AbstractModel):
notification_body = '{} File(s)'.format(attachments)
partners_to_notify = self.channel_partner_ids.filtered(lambda r: r.id != self.env.user.partner_id.id)
for employee_id in partners_to_notify.user_ids.employee_id:
push_notify = employee_id.user_push_notification(notification_body)
for employee_id in self.env['hr.employee'].sudo().search([('user_id', 'in', partners_to_notify.user_ids.ids)]):
push_notify = employee_id.user_push_notification_web(notification_body)
return super(MailThread, self).message_post(message_type=message_type, **kwargs)