Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/email/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Email Openerp向多个收件人发送电子邮件_Email_Openerp - Fatal编程技术网

Email Openerp向多个收件人发送电子邮件

Email Openerp向多个收件人发送电子邮件,email,openerp,Email,Openerp,我正在使用模板发送电子邮件。我想将电子邮件发送给多个收件人,但在字段email_中,仅接受对象属性: <field name="email_to">${object.attribute}</field> def action_send_email_to_attendees(self, cr, uid, ids, context=None): ''' This function opens a window to compose an em

我正在使用模板发送电子邮件。我想将电子邮件发送给多个收件人,但在字段email_中,仅接受对象属性:

<field name="email_to">${object.attribute}</field>
def action_send_email_to_attendees(self, cr, uid, ids, context=None):
        '''
        This function opens a window to compose an email
        '''
        assert len(ids) == 1, 'This option should only be used for a single id at a time.'
        ir_model_data = self.pool.get('ir.model.data')
        try:
            template_id = ir_model_data.get_object_reference(cr, uid, 'mymodule', 'mymodule_invitation_email')[1]
        except ValueError:
            template_id = False
        try:
            compose_form_id = ir_model_data.get_object_reference(cr, uid, 'mail', 'email_compose_message_wizard_form')[1]
        except ValueError:
            compose_form_id = False 
        ctx = dict(context)
        ctx.update({
            'default_model': 'mymodule.module',
            'default_res_id': ids[0],
            'default_use_template': bool(template_id),
            'default_template_id': template_id,
            'default_composition_mode': 'comment',
            'mark_so_as_sent': True
        })
        return {
            'type': 'ir.actions.act_window',
            'view_type': 'form',
            'view_mode': 'form',
            'res_model': 'mail.compose.message',
            'views': [(compose_form_id, 'form')],
            'view_id': compose_form_id,
            'target': 'new',
            'context': ctx,
        }