Create get_mass_mailing_action method

This commit is contained in:
Youssef Elouahby 2018-11-12 18:02:21 +01:00
parent a8260853e3
commit 8c044023d8

View File

@ -25,5 +25,17 @@ class GolemMember(models.Model):
_inherit = 'golem.member' _inherit = 'golem.member'
@api.multi @api.multi
def getPartners(self): def get_mass_mailing_action(self):
return self.mapped('partner_id').ids """ Call member mass mailing presend wizard """
partners = self.mapped('partner_id').ids
presend_wizard = self.env['golem.mail.presend.wizard'].create(
{'partner_ids': [(6, 0, partners)]})
return {
'type': 'ir.actions.act_window',
'name': 'Member mass mailing',
'res_model': 'golem.mail.presend.wizard',
'res_id': presend_wizard.id,
'view_mode': 'form',
'view_type': 'form',
'target': 'new'
}