I need to redefine mail_thread.message_post to change it's behaviour in version 8.0.
I've tried:
class MailThread(osv.AbstractModel):
""" Update MailThread to add the feature """
_inherit = 'mail.thread'
@api.cr_uid_ids_context
def message_post(self, cr, uid, thread_id, body='', subject=None,
type='notification', subtype=None, parent_id=False,
attachments=None, context=None, content_subtype='html',
**kwargs):
* * MY CODE * *
thread_id = super(MailThread, self).message_post(self, cr, uid, thread_id,
body=body, subject=subject, type=type, subtype=subtype,
parent_id=parent_id, attachments=attachments,
context=nosub_ctx, content_subtype=content_subtype, **kwargs)
return thread_id
But my method is never called...
I've searched the code and found that others modules do that, could it be that theirs are not being executed also, or do they do something I'm missing? (ex: addons mass_mailing)
I've tried also with class name as mail_thread, no success.
I've looked to this code:
https://github.com/hbrunn/social/blob/8.0-mail_follower_custom_notification/mail_follower_custom_notification/models/mail_thread.py
But applying it makes mail_thread.message_post undefined.
Can one point me the right direction, thanks in advance!
Have you listed "mail" module as a dependency in a manifest file of your module (the 'depends' list in the __openerp__.py file)?
yes I did... :/ and not working
Any further help on this?