I need to send a inbox message when I call this function, but I just get error ...
from odoo import models, fields, api, _
class MyModel(models.Model):
_inherit = ['mail.thread']
def inbox_message(self):
notification_ids = [(0, 0, {
'res_partner_id': self.user_id.partner_id.id,
'notification_type': 'inbox'
})]
self.message_post(body='This picking has been validated!', message_type="notification",
subtype="mail.mt_comment", author_id=self.env.user.partner_id.id,
notification_ids=notification_ids)
And it's returning this error:
An error occurred when sending an email