cubells
8 years ago
committed by
David Vidal
29 changed files with 55 additions and 320 deletions
-
12mail_tracking_mass_mailing/README.rst
-
3mail_tracking_mass_mailing/__init__.py
-
5mail_tracking_mass_mailing/__openerp__.py
-
3mail_tracking_mass_mailing/hooks.py
-
17mail_tracking_mass_mailing/i18n/ca.po
-
17mail_tracking_mass_mailing/i18n/de.po
-
17mail_tracking_mass_mailing/i18n/el_GR.po
-
18mail_tracking_mass_mailing/i18n/es.po
-
17mail_tracking_mass_mailing/i18n/es_CO.po
-
17mail_tracking_mass_mailing/i18n/fr.po
-
17mail_tracking_mass_mailing/i18n/hr.po
-
17mail_tracking_mass_mailing/i18n/it.po
-
17mail_tracking_mass_mailing/i18n/pt.po
-
17mail_tracking_mass_mailing/i18n/pt_BR.po
-
19mail_tracking_mass_mailing/i18n/sl.po
-
17mail_tracking_mass_mailing/i18n/tr.po
-
4mail_tracking_mass_mailing/models/__init__.py
-
15mail_tracking_mass_mailing/models/mail_mail.py
-
3mail_tracking_mass_mailing/models/mail_mail_statistics.py
-
31mail_tracking_mass_mailing/models/mail_mass_mailing.py
-
3mail_tracking_mass_mailing/models/mail_mass_mailing_contact.py
-
3mail_tracking_mass_mailing/models/mail_tracking_email.py
-
3mail_tracking_mass_mailing/models/mail_tracking_event.py
-
3mail_tracking_mass_mailing/tests/__init__.py
-
33mail_tracking_mass_mailing/tests/test_mass_mailing.py
-
9mail_tracking_mass_mailing/views/mail_mail_statistics_view.xml
-
9mail_tracking_mass_mailing/views/mail_mass_mailing_contact_view.xml
-
20mail_tracking_mass_mailing/views/mail_mass_mailing_view.xml
-
9mail_tracking_mass_mailing/views/mail_tracking_email_view.xml
@ -1,5 +1,6 @@ |
|||||
# -*- coding: utf-8 -*- |
# -*- coding: utf-8 -*- |
||||
# © 2016 Antonio Espinosa - <antonio.espinosa@tecnativa.com> |
|
||||
|
# Copyright 2016 Antonio Espinosa - <antonio.espinosa@tecnativa.com> |
||||
|
# Copyright 2017 Vicent Cubells - <vicent.cubells@tecnativa.com> |
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). |
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). |
||||
|
|
||||
from . import models |
from . import models |
||||
|
@ -1,10 +1,10 @@ |
|||||
# -*- coding: utf-8 -*- |
# -*- coding: utf-8 -*- |
||||
# © 2016 Antonio Espinosa - <antonio.espinosa@tecnativa.com> |
|
||||
|
# Copyright 2016 Antonio Espinosa - <antonio.espinosa@tecnativa.com> |
||||
|
# Copyright 2017 Vicent Cubells - <vicent.cubells@tecnativa.com> |
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). |
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). |
||||
|
|
||||
from . import mail_mail |
from . import mail_mail |
||||
from . import mail_tracking_email |
from . import mail_tracking_email |
||||
from . import mail_tracking_event |
from . import mail_tracking_event |
||||
from . import mail_mail_statistics |
from . import mail_mail_statistics |
||||
from . import mail_mass_mailing |
|
||||
from . import mail_mass_mailing_contact |
from . import mail_mass_mailing_contact |
@ -1,31 +0,0 @@ |
|||||
# -*- coding: utf-8 -*- |
|
||||
# © 2016 Antonio Espinosa - <antonio.espinosa@tecnativa.com> |
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). |
|
||||
|
|
||||
from openerp import models, api, fields, _ |
|
||||
from openerp.exceptions import Warning as UserError |
|
||||
|
|
||||
|
|
||||
class MailMassMailing(models.Model): |
|
||||
_inherit = 'mail.mass_mailing' |
|
||||
|
|
||||
avoid_resend = fields.Boolean( |
|
||||
string="Avoid resend", |
|
||||
help="Avoid to send this mass mailing email twice " |
|
||||
"to the same recipient") |
|
||||
|
|
||||
@api.model |
|
||||
def get_recipients(self, mailing): |
|
||||
res_ids = super(MailMassMailing, self).get_recipients(mailing) |
|
||||
if mailing.avoid_resend: |
|
||||
already_sent = self.env['mail.mail.statistics'].search([ |
|
||||
('mass_mailing_id', '=', mailing.id), |
|
||||
('model', '=', mailing.mailing_model), |
|
||||
]) |
|
||||
res_ids = list(set(res_ids).difference( |
|
||||
already_sent.mapped('res_id'))) |
|
||||
if not res_ids: |
|
||||
raise UserError(_( |
|
||||
"There is no more recipients to send and 'Avoid resend' " |
|
||||
"option is enabled")) |
|
||||
return res_ids |
|
@ -1,5 +1,6 @@ |
|||||
# -*- coding: utf-8 -*- |
# -*- coding: utf-8 -*- |
||||
# © 2016 Antonio Espinosa - <antonio.espinosa@tecnativa.com> |
|
||||
|
# Copyright 2016 Antonio Espinosa - <antonio.espinosa@tecnativa.com> |
||||
|
# Copyright 2017 Vicent Cubells - <vicent.cubells@tecnativa.com> |
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). |
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). |
||||
|
|
||||
from . import test_mass_mailing |
from . import test_mass_mailing |
Write
Preview
Loading…
Cancel
Save
Reference in new issue