Browse Source

[MIG] mass_mailing_partner: Migration to 10.0

pull/171/head
David Vidal 8 years ago
committed by Pedro M. Baeza
parent
commit
2837986c65
  1. 44
      mass_mailing_partner/README.rst
  2. 7
      mass_mailing_partner/__init__.py
  3. 13
      mass_mailing_partner/__manifest__.py
  4. 10
      mass_mailing_partner/hooks.py
  5. 140
      mass_mailing_partner/i18n/mass_mailing_partner.pot
  6. 7
      mass_mailing_partner/models/__init__.py
  7. 5
      mass_mailing_partner/models/mail_mail_statistics.py
  8. 8
      mass_mailing_partner/models/mail_mass_mailing.py
  9. 21
      mass_mailing_partner/models/mail_mass_mailing_contact.py
  10. 32
      mass_mailing_partner/models/res_partner.py
  11. 6
      mass_mailing_partner/tests/__init__.py
  12. 8
      mass_mailing_partner/tests/base.py
  13. 4
      mass_mailing_partner/tests/test_mail_mail_statistics.py
  14. 6
      mass_mailing_partner/tests/test_mail_mass_mailing_contact.py
  15. 8
      mass_mailing_partner/tests/test_partner_mail_list_wizard.py
  16. 8
      mass_mailing_partner/tests/test_res_partner.py
  17. 8
      mass_mailing_partner/views/mail_mail_statistics_view.xml
  18. 14
      mass_mailing_partner/views/mail_mass_mailing_contact_view.xml
  19. 12
      mass_mailing_partner/views/mail_mass_mailing_view.xml
  20. 16
      mass_mailing_partner/views/res_partner_view.xml
  21. 6
      mass_mailing_partner/wizard/__init__.py
  22. 10
      mass_mailing_partner/wizard/partner_mail_list_wizard.py
  23. 13
      mass_mailing_partner/wizard/partner_mail_list_wizard.xml

44
mass_mailing_partner/README.rst

@ -24,16 +24,6 @@ Configuration
At first install, all existing mass mailing contacts are matched against At first install, all existing mass mailing contacts are matched against
partners. And also mass mailing statistics are matched using model and res_id. partners. And also mass mailing statistics are matched using model and res_id.
NOTE: When upgrading from version 1.0.0, no mass mailing statistics matching
are done, because it is done only when installing. You can execute 'partner_link'
method to all stats using odoo shell or any XML client:
.. code:: python
# odoo.py --addons-path=<addons_path_list> shell --config=<odoo_config_file> -d <database>
stats = self.env['mail.mail.statistics'].search([('model', '!=', False), ('res_id', '!=', False)])
stats.partner_link()
Usage Usage
===== =====
@ -43,34 +33,16 @@ as mailing list contacts.
.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas .. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas
:alt: Try me on Runbot :alt: Try me on Runbot
:target: https://runbot.odoo-community.org/runbot/111/8.0
:target: https://runbot.odoo-community.org/runbot/205/10.0
Bug Tracker Bug Tracker
=========== ===========
Bugs are tracked on `GitHub Issues <https://github.com/OCA/crm/issues>`_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us smashing it by providing a detailed and welcomed feedback
`here <https://github.com/OCA/crm/issues/new?body=module:%20mass_mailing_partner%0Aversion:%208.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
License
=======
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published
by the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/agpl-3.0-standalone.html>.
Bugs are tracked on `GitHub Issues
<https://github.com/OCA/social/issues>`_. In case of trouble, please
check there if your issue has already been reported. If you spotted it first,
help us smash it by providing detailed and welcomed feedback.
Credits Credits
======= =======
@ -78,11 +50,13 @@ Credits
Contributors Contributors
------------ ------------
* Pedro M. Baeza <pedro.baeza@serviciosbaeza.com>
* Pedro M. Baeza <pedro.baeza@tecnativa.com>
* Rafael Blasco <rafael.blasco@tecnativa.com> * Rafael Blasco <rafael.blasco@tecnativa.com>
* Antonio Espinosa <antonioea@antiun.com>
* Antonio Espinosa <antonio.espinosa@tecnativa.com>
* Javier Iniesta <javieria@antiun.com> * Javier Iniesta <javieria@antiun.com>
* Jairo Llopis <jairo.llopis@tecnativa.com> * Jairo Llopis <jairo.llopis@tecnativa.com>
* David Vidal <david.vidal@tecnativa.com>
Maintainer Maintainer
---------- ----------

7
mass_mailing_partner/__init__.py

@ -1,8 +1,7 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# © 2015 Pedro M. Baeza <pedro.baeza@serviciosbaeza.com>
# © 2015 Antonio Espinosa <antonioea@antiun.com>
# © 2015 Javier Iniesta <javieria@antiun.com>
# © 2016 Antonio Espinosa - <antonio.espinosa@tecnativa.com>
# Copyright 2015 Pedro M. Baeza <pedro.baeza@tecnativa.com>
# Copyright 2015 Antonio Espinosa <antonio.espinosa@tecnativa.com>
# Copyright 2015 Javier Iniesta <javieria@antiun.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

13
mass_mailing_partner/__openerp__.py → mass_mailing_partner/__manifest__.py

@ -1,17 +1,16 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# © 2015 Pedro M. Baeza <pedro.baeza@serviciosbaeza.com>
# © 2015 Antonio Espinosa <antonioea@antiun.com>
# © 2015 Javier Iniesta <javieria@antiun.com>
# © 2016 Antonio Espinosa - <antonio.espinosa@tecnativa.com>
# Copyright 2015 Pedro M. Baeza <pedro.baeza@tecnativa.com>
# Copyright 2015 Antonio Espinosa <antonio.espinosa@tecnativa.com>
# Copyright 2015 Javier Iniesta <javieria@antiun.com>
# Copyright 2016 Antonio Espinosa - <antonio.espinosa@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).
{ {
"name": "Link partners with mass-mailing", "name": "Link partners with mass-mailing",
"version": "8.0.2.1.0",
"version": "10.0.1.0.0",
"author": "Tecnativa, " "author": "Tecnativa, "
"Antiun Ingeniería S.L., "
"Serv. Tecnol. Avanzados - Pedro M. Baeza, "
"Odoo Community Association (OCA)", "Odoo Community Association (OCA)",
"website": "https://www.tecnativa.com",
"license": "AGPL-3", "license": "AGPL-3",
"category": "Marketing", "category": "Marketing",
"depends": [ "depends": [

10
mass_mailing_partner/hooks.py

@ -1,12 +1,12 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# © 2015 Pedro M. Baeza <pedro.baeza@serviciosbaeza.com>
# © 2015 Antonio Espinosa <antonioea@antiun.com>
# © 2015 Javier Iniesta <javieria@antiun.com>
# © 2016 Antonio Espinosa - <antonio.espinosa@tecnativa.com>
# Copyright 2015 Pedro M. Baeza <pedro.baeza@tecnativa.com>
# Copyright 2015 Antonio Espinosa <antonio.espinosa@tecnativa.com>
# Copyright 2015 Javier Iniesta <javieria@antiun.com>
# Copyright 2016 Antonio Espinosa - <antonio.espinosa@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).
import logging import logging
from openerp import api, SUPERUSER_ID
from odoo import api, SUPERUSER_ID
_logger = logging.getLogger(__name__) _logger = logging.getLogger(__name__)

140
mass_mailing_partner/i18n/mass_mailing_partner.pot

@ -1,140 +0,0 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * mass_mailing_partner
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 8.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2015-11-03 14:42+0000\n"
"PO-Revision-Date: 2015-11-03 14:42+0000\n"
"Last-Translator: <>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"
#. module: mass_mailing_partner
#: view:partner.mail.list.wizard:mass_mailing_partner.partner_mail_list_wizard_form
msgid "Add contacts to mailing list"
msgstr ""
#. module: mass_mailing_partner
#: model:ir.actions.act_window,name:mass_mailing_partner.action_partner_mail_list
msgid "Add to mailing list"
msgstr ""
#. module: mass_mailing_partner
#: view:partner.mail.list.wizard:mass_mailing_partner.partner_mail_list_wizard_form
msgid "Cancel"
msgstr ""
#. module: mass_mailing_partner
#: model:ir.model,name:mass_mailing_partner.model_partner_mail_list_wizard
#: view:partner.mail.list.wizard:mass_mailing_partner.partner_mail_list_wizard_form
msgid "Create contact mailing list"
msgstr ""
#. module: mass_mailing_partner
#: field:partner.mail.list.wizard,create_uid:0
msgid "Created by"
msgstr ""
#. module: mass_mailing_partner
#: field:partner.mail.list.wizard,create_date:0
msgid "Created on"
msgstr ""
#. module: mass_mailing_partner
#: field:partner.mail.list.wizard,id:0
msgid "ID"
msgstr ""
#. module: mass_mailing_partner
#: field:partner.mail.list.wizard,write_uid:0
msgid "Last Updated by"
msgstr ""
#. module: mass_mailing_partner
#: field:partner.mail.list.wizard,write_date:0
msgid "Last Updated on"
msgstr ""
#. module: mass_mailing_partner
#: model:ir.model,name:mass_mailing_partner.model_mail_mass_mailing_list
#: field:partner.mail.list.wizard,mail_list_id:0
#: view:res.partner:mass_mailing_partner.view_res_partner_filter
msgid "Mailing List"
msgstr ""
#. module: mass_mailing_partner
#: field:res.partner,mass_mailing_contacts_count:0
msgid "Mailing list number"
msgstr ""
#. module: mass_mailing_partner
#: view:res.partner:mass_mailing_partner.view_partner_form
msgid "Mailing lists"
msgstr ""
#. module: mass_mailing_partner
#: field:mail.mass_mailing.list,partner_mandatory:0
msgid "Mandatory Partner"
msgstr ""
#. module: mass_mailing_partner
#: model:ir.model,name:mass_mailing_partner.model_mail_mass_mailing_contact
msgid "Mass Mailing Contact"
msgstr ""
#. module: mass_mailing_partner
#: field:res.partner,mass_mailing_contacts:0
msgid "Mass mailing contacts"
msgstr ""
#. module: mass_mailing_partner
#: model:ir.model,name:mass_mailing_partner.model_res_partner
#: view:mail.mass_mailing.contact:mass_mailing_partner.view_mail_mass_mailing_contact_search
#: field:mail.mass_mailing.contact,partner_id:0
msgid "Partner"
msgstr ""
#. module: mass_mailing_partner
#: code:addons/mass_mailing_partner/wizard/partner_mail_list_wizard.py:24
#, python-format
msgid "Partner '%s' has no email."
msgstr ""
#. module: mass_mailing_partner
#: field:mail.mass_mailing.list,partner_category:0
msgid "Partner Tag"
msgstr ""
#. module: mass_mailing_partner
#: code:addons/mass_mailing_partner/models/mail_mass_mailing_contact.py:15
#: sql_constraint:mail.mass_mailing.contact:0
#, python-format
msgid "Partner already exists in this mailing list."
msgstr ""
#. module: mass_mailing_partner
#: field:partner.mail.list.wizard,partner_ids:0
msgid "Partner ids"
msgstr ""
#. module: mass_mailing_partner
#: code:addons/mass_mailing_partner/models/res_partner.py:23
#, python-format
msgid "This partner '%s' is subscribed to one or more mailing lists. Email must be assigned."
msgstr ""
#. module: mass_mailing_partner
#: view:partner.mail.list.wizard:mass_mailing_partner.partner_mail_list_wizard_form
msgid "or"
msgstr ""
#. module: mass_mailing_partner
#: view:mail.mass_mailing.contact:mass_mailing_partner.view_mail_mass_mailing_contact_tree
msgid "{'readonly': [('partner_id', '!=', False)]}"
msgstr ""

7
mass_mailing_partner/models/__init__.py

@ -1,8 +1,7 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# © 2015 Pedro M. Baeza <pedro.baeza@serviciosbaeza.com>
# © 2015 Antonio Espinosa <antonioea@antiun.com>
# © 2015 Javier Iniesta <javieria@antiun.com>
# © 2016 Antonio Espinosa - <antonio.espinosa@tecnativa.com>
# Copyright 2015 Pedro M. Baeza <pedro.baeza@tecnativa.com>
# Copyright 2015 Antonio Espinosa <antonio.espinosa@tecnativa.com>
# Copyright 2015 Javier Iniesta <javieria@antiun.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_mass_mailing_contact from . import mail_mass_mailing_contact

5
mass_mailing_partner/models/mail_mail_statistics.py

@ -1,8 +1,8 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# © 2016 Antonio Espinosa - <antonio.espinosa@tecnativa.com>
# Copyright 2016 Antonio Espinosa - <antonio.espinosa@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 openerp import models, fields, api
from odoo import api, fields, models
class MailMailStatistics(models.Model): class MailMailStatistics(models.Model):
@ -22,7 +22,6 @@ class MailMailStatistics(models.Model):
partner_id = obj.partner_id.id partner_id = obj.partner_id.id
return partner_id return partner_id
@api.multi
def partner_link(self): def partner_link(self):
for stat in self.filtered(lambda r: r.model and r.res_id): for stat in self.filtered(lambda r: r.model and r.res_id):
partner_id = self.partner_id_from_obj(stat.model, stat.res_id) partner_id = self.partner_id_from_obj(stat.model, stat.res_id)

8
mass_mailing_partner/models/mail_mass_mailing.py

@ -1,10 +1,10 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# © 2015 Pedro M. Baeza <pedro.baeza@serviciosbaeza.com>
# © 2015 Antonio Espinosa <antonioea@antiun.com>
# © 2015 Javier Iniesta <javieria@antiun.com>
# Copyright 2015 Pedro M. Baeza <pedro.baeza@tecnativa.com>
# Copyright 2015 Antonio Espinosa <antonio.espinosa@tecnativa.com>
# Copyright 2015 Javier Iniesta <javieria@antiun.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 openerp import models, fields
from odoo import fields, models
class MailMassMailingList(models.Model): class MailMassMailingList(models.Model):

21
mass_mailing_partner/models/mail_mass_mailing_contact.py

@ -1,11 +1,11 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# © 2015 Pedro M. Baeza <pedro.baeza@serviciosbaeza.com>
# © 2015 Antonio Espinosa <antonioea@antiun.com>
# © 2015 Javier Iniesta <javieria@antiun.com>
# © 2016 Antonio Espinosa - <antonio.espinosa@tecnativa.com>
# Copyright 2015 Pedro M. Baeza <pedro.baeza@tecnativa.com>
# Copyright 2015 Antonio Espinosa <antonio.espinosa@tecnativa.com>
# Copyright 2015 Javier Iniesta <javieria@antiun.com>
# Copyright 2017 David Vidal <david.vidal@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 openerp import models, fields, api, _
from odoo import _, api, fields, models
class MailMassMailingContact(models.Model): class MailMassMailingContact(models.Model):
@ -19,7 +19,6 @@ class MailMassMailingContact(models.Model):
_('Partner already exists in this mailing list.')) _('Partner already exists in this mailing list.'))
] ]
@api.one
@api.onchange('partner_id') @api.onchange('partner_id')
def _onchange_partner(self): def _onchange_partner(self):
if self.partner_id: if self.partner_id:
@ -34,12 +33,12 @@ class MailMassMailingContact(models.Model):
vals = self._set_name_email(vals) vals = self._set_name_email(vals)
return super(MailMassMailingContact, self).create(vals) return super(MailMassMailingContact, self).create(vals)
@api.one
def write(self, vals): def write(self, vals):
if vals.get('partner_id', None) is False:
# If removing partner, search again by email
vals = self._set_partner(vals)
vals = self._set_name_email(vals)
for contact in self:
if vals.get('partner_id', None) is False:
# If removing partner, search again by email
vals = contact._set_partner(vals)
vals = contact._set_name_email(vals)
return super(MailMassMailingContact, self).write(vals) return super(MailMassMailingContact, self).write(vals)
def _prepare_partner(self, vals, mailing_list): def _prepare_partner(self, vals, mailing_list):

32
mass_mailing_partner/models/res_partner.py

@ -1,12 +1,12 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# © 2015 Pedro M. Baeza <pedro.baeza@serviciosbaeza.com>
# © 2015 Antonio Espinosa <antonioea@antiun.com>
# © 2015 Javier Iniesta <javieria@antiun.com>
# © 2016 Antonio Espinosa - <antonio.espinosa@tecnativa.com>
# Copyright 2015 Pedro M. Baeza <pedro.baeza@tecnativa.com>
# Copyright 2015 Antonio Espinosa <antonio.espinosa@tecnativa.com>
# Copyright 2015 Javier Iniesta <javieria@antiun.com>
# Copyright 2017 David Vidal <david.vidal@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 openerp import models, fields, api, _
from openerp.exceptions import ValidationError
from odoo import _, api, fields, models
from odoo.exceptions import ValidationError
class ResPartner(models.Model): class ResPartner(models.Model):
@ -27,26 +27,26 @@ class ResPartner(models.Model):
string='Mass mailing stats number', string='Mass mailing stats number',
compute='_compute_mass_mailing_stats_count', store=True) compute='_compute_mass_mailing_stats_count', store=True)
@api.one
@api.constrains('email') @api.constrains('email')
def _check_email_mass_mailing_contacts(self): def _check_email_mass_mailing_contacts(self):
if self.mass_mailing_contact_ids and not self.email:
raise ValidationError(
_("This partner '%s' is subscribed to one or more "
"mailing lists. Email must be assigned." % self.name))
for partner in self:
if partner.mass_mailing_contact_ids and not partner.email:
raise ValidationError(
_("This partner '%s' is subscribed to one or more "
"mailing lists. Email must be assigned.") % partner.name)
@api.one
@api.depends('mass_mailing_contact_ids', @api.depends('mass_mailing_contact_ids',
'mass_mailing_contact_ids.opt_out') 'mass_mailing_contact_ids.opt_out')
def _compute_mass_mailing_contacts_count(self): def _compute_mass_mailing_contacts_count(self):
self.mass_mailing_contacts_count = len(self.mass_mailing_contact_ids)
for reg in self:
reg.mass_mailing_contacts_count = len(
reg.mass_mailing_contact_ids)
@api.one
@api.depends('mass_mailing_stats') @api.depends('mass_mailing_stats')
def _compute_mass_mailing_stats_count(self): def _compute_mass_mailing_stats_count(self):
self.mass_mailing_stats_count = len(self.mass_mailing_stats)
for reg in self:
reg.mass_mailing_stats_count = len(reg.mass_mailing_stats)
@api.multi
def write(self, vals): def write(self, vals):
res = super(ResPartner, self).write(vals) res = super(ResPartner, self).write(vals)
if vals.get('name') or vals.get('email'): if vals.get('name') or vals.get('email'):

6
mass_mailing_partner/tests/__init__.py

@ -1,7 +1,7 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# © 2015 Pedro M. Baeza <pedro.baeza@serviciosbaeza.com>
# © 2015 Antonio Espinosa <antonioea@antiun.com>
# © 2015 Javier Iniesta <javieria@antiun.com>
# Copyright 2015 Pedro M. Baeza <pedro.baeza@tecnativa.com>
# Copyright 2015 Antonio Espinosa <antonio.espinosa@tecnativa.com>
# Copyright 2015 Javier Iniesta <javieria@antiun.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_mail_mass_mailing_contact, test_res_partner from . import test_mail_mass_mailing_contact, test_res_partner

8
mass_mailing_partner/tests/base.py

@ -1,10 +1,10 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# © 2015 Pedro M. Baeza <pedro.baeza@serviciosbaeza.com>
# © 2015 Antonio Espinosa <antonioea@antiun.com>
# © 2015 Javier Iniesta <javieria@antiun.com>
# Copyright 2015 Pedro M. Baeza <pedro.baeza@tecnativa.com>
# Copyright 2015 Antonio Espinosa <antonio.espinosa@tecnativa.com>
# Copyright 2015 Javier Iniesta <javieria@antiun.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 openerp.tests.common import TransactionCase
from odoo.tests.common import TransactionCase
class BaseCase(TransactionCase): class BaseCase(TransactionCase):

4
mass_mailing_partner/tests/test_mail_mail_statistics.py

@ -1,5 +1,7 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# © 2016 Antonio Espinosa <antonio.espinosa@tecnativa.com>
# Copyright 2015 Pedro M. Baeza <pedro.baeza@tecnativa.com>
# Copyright 2015 Antonio Espinosa <antonio.espinosa@tecnativa.com>
# Copyright 2015 Javier Iniesta <javieria@antiun.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 base from . import base

6
mass_mailing_partner/tests/test_mail_mass_mailing_contact.py

@ -1,7 +1,7 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# © 2015 Pedro M. Baeza <pedro.baeza@serviciosbaeza.com>
# © 2015 Antonio Espinosa <antonioea@antiun.com>
# © 2015 Javier Iniesta <javieria@antiun.com>
# Copyright 2015 Pedro M. Baeza <pedro.baeza@tecnativa.com>
# Copyright 2015 Antonio Espinosa <antonio.espinosa@tecnativa.com>
# Copyright 2015 Javier Iniesta <javieria@antiun.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 base from . import base

8
mass_mailing_partner/tests/test_partner_mail_list_wizard.py

@ -1,11 +1,11 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# © 2015 Pedro M. Baeza <pedro.baeza@serviciosbaeza.com>
# © 2015 Antonio Espinosa <antonioea@antiun.com>
# © 2015 Javier Iniesta <javieria@antiun.com>
# Copyright 2015 Pedro M. Baeza <pedro.baeza@tecnativa.com>
# Copyright 2015 Antonio Espinosa <antonio.espinosa@tecnativa.com>
# Copyright 2015 Javier Iniesta <javieria@antiun.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 base from . import base
from openerp.exceptions import Warning as UserError
from odoo.exceptions import UserError
class PartnerMailListWizardCase(base.BaseCase): class PartnerMailListWizardCase(base.BaseCase):

8
mass_mailing_partner/tests/test_res_partner.py

@ -1,11 +1,11 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# © 2015 Pedro M. Baeza <pedro.baeza@serviciosbaeza.com>
# © 2015 Antonio Espinosa <antonioea@antiun.com>
# © 2015 Javier Iniesta <javieria@antiun.com>
# Copyright 2015 Pedro M. Baeza <pedro.baeza@tecnativa.com>
# Copyright 2015 Antonio Espinosa <antonio.espinosa@tecnativa.com>
# Copyright 2015 Javier Iniesta <javieria@antiun.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 base from . import base
from openerp.exceptions import ValidationError
from odoo.exceptions import ValidationError
class ResPartnerCase(base.BaseCase): class ResPartnerCase(base.BaseCase):

8
mass_mailing_partner/views/mail_mail_statistics_view.xml

@ -1,8 +1,7 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<!-- © 2016 Antonio Espinosa - <antonio.espinosa@tecnativa.com>
<!-- Copyright 2016 Antonio Espinosa - <antonio.espinosa@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). -->
<openerp>
<data>
<odoo>
<record model="ir.ui.view" id="view_mail_mail_statistics_form"> <record model="ir.ui.view" id="view_mail_mail_statistics_form">
<field name="name">Add partner field</field> <field name="name">Add partner field</field>
@ -42,5 +41,4 @@
</field> </field>
</record> </record>
</data>
</openerp>
</odoo>

14
mass_mailing_partner/views/mail_mass_mailing_contact_view.xml

@ -1,11 +1,10 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<!-- © 2015 Pedro M. Baeza <pedro.baeza@serviciosbaeza.com>
© 2015 Antonio Espinosa <antonioea@antiun.com>
© 2015 Javier Iniesta <javieria@antiun.com>
© 2016 Antonio Espinosa - <antonio.espinosa@tecnativa.com>
<!-- Copyright 2015 Pedro M. Baeza <pedro.baeza@tecnativa.com>
Copyright 2015 Antonio Espinosa <antonio.espinosa@tecnativa.com>
Copyright 2015 Javier Iniesta <javieria@antiun.com>
Copyright 2016 Antonio Espinosa - <antonio.espinosa@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). -->
<openerp>
<data>
<odoo>
<record model="ir.ui.view" id="view_mail_mass_mailing_contact_tree"> <record model="ir.ui.view" id="view_mail_mass_mailing_contact_tree">
<field name="name">mail.mass_mailing.contact.tree.partner</field> <field name="name">mail.mass_mailing.contact.tree.partner</field>
@ -40,5 +39,4 @@
</field> </field>
</record> </record>
</data>
</openerp>
</odoo>

12
mass_mailing_partner/views/mail_mass_mailing_view.xml

@ -1,10 +1,9 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<!-- © 2015 Pedro M. Baeza <pedro.baeza@serviciosbaeza.com>
© 2015 Antonio Espinosa <antonioea@antiun.com>
© 2015 Javier Iniesta <javieria@antiun.com>
<!-- Copyright 2015 Pedro M. Baeza <pedro.baeza@tecnativa.com>
Copyright 2015 Antonio Espinosa <antonio.espinosa@tecnativa.com>
Copyright 2015 Javier Iniesta <javieria@antiun.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). -->
<openerp>
<data>
<odoo>
<record model="ir.ui.view" id="view_mail_mass_mailing_list_form"> <record model="ir.ui.view" id="view_mail_mass_mailing_list_form">
<field name="name">mail.mass_mailing.list.form</field> <field name="name">mail.mass_mailing.list.form</field>
@ -22,5 +21,4 @@
</field> </field>
</record> </record>
</data>
</openerp>
</odoo>

16
mass_mailing_partner/views/res_partner_view.xml

@ -1,18 +1,17 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<!-- © 2015 Pedro M. Baeza <pedro.baeza@serviciosbaeza.com>
© 2015 Antonio Espinosa <antonioea@antiun.com>
© 2015 Javier Iniesta <javieria@antiun.com>
© 2016 Antonio Espinosa - <antonio.espinosa@tecnativa.com>
<!-- Copyright 2015 Pedro M. Baeza <pedro.baeza@tecnativa.com>
Copyright 2015-16 Antonio Espinosa <antonio.espinosa@tecnativa.com>
Copyright 2015 Javier Iniesta <javieria@antiun.com>
Copyright 2016 Antonio Espinosa - <antonio.espinosa@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). -->
<openerp>
<data>
<odoo>
<record model="ir.ui.view" id="view_partner_form"> <record model="ir.ui.view" id="view_partner_form">
<field name="name">Partner Form with mailing contacts</field> <field name="name">Partner Form with mailing contacts</field>
<field name="model">res.partner</field> <field name="model">res.partner</field>
<field name="inherit_id" ref="base.view_partner_form"/> <field name="inherit_id" ref="base.view_partner_form"/>
<field name="arch" type="xml"> <field name="arch" type="xml">
<div class="oe_right oe_button_box" position="inside">
<div name="button_box" position="inside">
<button name="%(mass_mailing.action_view_mass_mailing_contacts)d" <button name="%(mass_mailing.action_view_mass_mailing_contacts)d"
context="{'search_default_partner_id': active_id, context="{'search_default_partner_id': active_id,
'default_partner_id': active_id}" 'default_partner_id': active_id}"
@ -50,5 +49,4 @@
</field> </field>
</record> </record>
</data>
</openerp>
</odoo>

6
mass_mailing_partner/wizard/__init__.py

@ -1,7 +1,7 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# © 2015 Pedro M. Baeza <pedro.baeza@serviciosbaeza.com>
# © 2015 Antonio Espinosa <antonioea@antiun.com>
# © 2015 Javier Iniesta <javieria@antiun.com>
# Copyright 2015 Pedro M. Baeza <pedro.baeza@tecnativa.com>
# Copyright 2015 Antonio Espinosa <antonio.espinosa@tecnativa.com>
# Copyright 2015 Javier Iniesta <javieria@antiun.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 partner_mail_list_wizard from . import partner_mail_list_wizard

10
mass_mailing_partner/wizard/partner_mail_list_wizard.py

@ -1,11 +1,11 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# © 2015 Pedro M. Baeza <pedro.baeza@serviciosbaeza.com>
# © 2015 Antonio Espinosa <antonioea@antiun.com>
# © 2015 Javier Iniesta <javieria@antiun.com>
# Copyright 2015 Pedro M. Baeza <pedro.baeza@tecnativa.com>
# Copyright 2015 Antonio Espinosa <antonio.espinosa@tecnativa.com>
# Copyright 2015 Javier Iniesta <javieria@antiun.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 openerp import models, api, fields, _
from openerp.exceptions import Warning as UserError
from odoo import _, api, fields, models
from odoo.exceptions import UserError
class PartnerMailListWizard(models.TransientModel): class PartnerMailListWizard(models.TransientModel):

13
mass_mailing_partner/wizard/partner_mail_list_wizard.xml

@ -1,10 +1,9 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<!-- © 2015 Pedro M. Baeza <pedro.baeza@serviciosbaeza.com>
© 2015 Antonio Espinosa <antonioea@antiun.com>
© 2015 Javier Iniesta <javieria@antiun.com>
<!-- Copyright 2015 Pedro M. Baeza <pedro.baeza@tecnativa.com>
Copyright 2015 Antonio Espinosa <antonio.espinosa@tecnativa.com>
Copyright 2015 Javier Iniesta <javieria@antiun.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). -->
<openerp>
<data>
<odoo>
<act_window name="Add to mailing list" <act_window name="Add to mailing list"
res_model="partner.mail.list.wizard" res_model="partner.mail.list.wizard"
@ -25,12 +24,10 @@
<footer> <footer>
<button string="Add contacts to mailing list" name="add_to_mail_list" <button string="Add contacts to mailing list" name="add_to_mail_list"
type="object" class="oe_highlight"/> type="object" class="oe_highlight"/>
or
<button string="Cancel" class="oe_link" special="cancel" /> <button string="Cancel" class="oe_link" special="cancel" />
</footer> </footer>
</form> </form>
</field> </field>
</record> </record>
</data>
</openerp>
</odoo>
Loading…
Cancel
Save