From 8c044023d827acc9935983ea9d4b0c5961ad615a Mon Sep 17 00:00:00 2001 From: youssef Date: Mon, 12 Nov 2018 18:02:21 +0100 Subject: [PATCH] Create get_mass_mailing_action method --- golem_mail_member/models/golem_member.py | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/golem_mail_member/models/golem_member.py b/golem_mail_member/models/golem_member.py index cc3b5eb..873a753 100644 --- a/golem_mail_member/models/golem_member.py +++ b/golem_mail_member/models/golem_member.py @@ -25,5 +25,17 @@ class GolemMember(models.Model): _inherit = 'golem.member' @api.multi - def getPartners(self): - return self.mapped('partner_id').ids + def get_mass_mailing_action(self): + """ 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' + }