How do I send an email to a discussion group in OpenERP 7?

  • I created a new discussion group in OpenERP 7 for messaging. I am trying to send an email notification to all group members when the task status changes. I have already tried creating an automatic action and a link to a server action such as email. But, in server actions, how to access a specific group? The name of the group is supervisors.

  • Is there a way to call mail when a specific function is called?

+4
source share
1 answer

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)

, , , , "" . , .

0

Source: https://habr.com/ru/post/1534189/


All Articles