Skip to content
Snippets Groups Projects
Commit ae04ea2b authored by Thibault Delavallée's avatar Thibault Delavallée
Browse files

[IMP] mail: add a post-process hook for message post

Models inheriting from mail.thread can override this method and hook
on post message_post event and perform some action depending on the
business flow.

Future commits will use that hook to update the record after posting
a message, like updating the customer.
parent 0389b304
No related branches found
No related tags found
No related merge requests found
......@@ -1894,8 +1894,14 @@ class MailThread(models.AbstractModel):
self.sudo().write({'message_last_post': fields.Datetime.now()})
if new_message.author_id and model and self.ids and message_type != 'notification' and not self._context.get('mail_create_nosubscribe'):
self.message_subscribe([new_message.author_id.id], force=False)
self._message_post_after_hook(new_message)
return new_message
def _message_post_after_hook(self, message):
pass
@api.multi
def message_post_with_view(self, views_or_xmlid, **kwargs):
""" Helper method to send a mail / post a message using a view_id to
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment