fix issue with notifications

This commit is contained in:
ronozoro 2024-08-14 13:42:31 +03:00
parent 044e3e230e
commit 3b1a62ddbc
No known key found for this signature in database
GPG Key ID: 7C2BDED35C62C0F3
1 changed files with 6 additions and 7 deletions

View File

@ -442,10 +442,9 @@ class Transaction(models.Model):
def action_send_notification(self, subj, msg, partner_ids):
self.ensure_one()
for rec in self:
author = self.env['res.users'].sudo().browse(self._uid)
author = author.id
if False not in partner_ids:
rec.message_post(type="notification", subject=subj, body=msg, author_id=author,
partner_ids=partner_ids,
subtype_xmlid="mail.mt_comment")
# for rec in self:
# partner_ids =list(filter(bool,partner_ids))
# rec.message_post(type="notification", subject=subj, body=msg, author_id=self.env.user.id,
# partner_ids=partner_ids,
# subtype_xmlid="mail.mt_comment")
return True