I had to solve the same thing, here is the fragment that I wrote:
def cron_notification(self, cr, uid, context=None):
mail_group_obj = self.pool.get('mail.group')
mail_group = mail_group_obj.browse(cr, uid, 4, context=context)
body = 'sexy body'
mail_group.message_post(body=body, subject=False, type='comment', context={
'default_model': 'mail.group',
'default_res_id': 4,
'mail_post_autofollow': True,
'mail_post_autofollow_partner_ids': [],
}, content_subtype='plaintext',
partner_ids=[],
attachment_ids=[],
subtype='mail.mt_comment'
)
return
"sexy body" id = 4. , , mail.group "" .
( , , "mail.group", mail.thread)
, , , , "" . , .