[FIX] odex_web_app: conflicts between 2 modules on user_push_notification function
This commit is contained in:
parent
1baab971e3
commit
87c463c039
|
|
@ -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',
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Reference in New Issue