I am trying to send notification to user A then user B Approves a task. (but using the odoobot user)
notification_ids = [(0,0,{'res_partner_id':user_id.partner_id.id,'notification_type':'inbox'})] self.sudo().message_post(subject=summary,body=summary_link,message_type='notification, subtype_xmlid='mail.mt_comment', author_id=odoo_bot_id.partner_id.id, notification_ids=notification_ids)
it was working but now i am going this:
ValueError: Posting a message should be done on a business document. Use message_notify to send a notification to an user.
if self._name == 'mail.thread' or not self.id or message_type == 'user_notification': raise ValueError(_('Posting a message should be done on a business document. Use message_notify to send a notification to an user.'))
what does not self.id mean
according to this I should use
message_notify_ids = [user_id.partner_id.id] record.sudo().message_notify(partner_ids=message_notify_ids, parent_id=odoo_bot_id.partner_id.id, author_id=odoo_bot_id.partner_id.id, body=summary_link, subject=summary)
this shows the popup notification but does not show in the index so the user can navigate to the task