Browse Source

[MIG] mass_mailing_partner: Migration to 10.0

pull/277/head
David Vidal 8 years ago
committed by Pedro M. Baeza
parent
commit
1657e77406
  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. 35
      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. 18
      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
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
=====
@ -43,34 +33,16 @@ as mailing list contacts.
.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas
: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
===========
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
=======
@ -78,11 +50,13 @@ Credits
Contributors
------------
* Pedro M. Baeza <pedro.baeza@serviciosbaeza.com>
* Pedro M. Baeza <pedro.baeza@tecnativa.com>
* Rafael Blasco <rafael.blasco@tecnativa.com>
* Antonio Espinosa <antonioea@antiun.com>
* Antonio Espinosa <antonio.espinosa@tecnativa.com>
* Javier Iniesta <javieria@antiun.com>
* Jairo Llopis <jairo.llopis@tecnativa.com>
* David Vidal <david.vidal@tecnativa.com>
Maintainer
----------

7
mass_mailing_partner/__init__.py

@ -1,8 +1,7 @@
# -*- 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).
from . import models

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

@ -1,17 +1,16 @@
# -*- 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).
{
"name": "Link partners with mass-mailing",
"version": "8.0.2.1.0",
"version": "10.0.1.0.1",
"author": "Tecnativa, "
"Antiun Ingeniería S.L., "
"Serv. Tecnol. Avanzados - Pedro M. Baeza, "
"Odoo Community Association (OCA)",
"website": "https://www.tecnativa.com",
"license": "AGPL-3",
"category": "Marketing",
"depends": [

10
mass_mailing_partner/hooks.py

@ -1,12 +1,12 @@
# -*- 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).
import logging
from openerp import api, SUPERUSER_ID
from odoo import api, SUPERUSER_ID
_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 -*-
# © 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).
from . import mail_mass_mailing_contact

5
mass_mailing_partner/models/mail_mail_statistics.py

@ -1,8 +1,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).
from openerp import models, fields, api
from odoo import api, fields, models
class MailMailStatistics(models.Model):
@ -22,7 +22,6 @@ class MailMailStatistics(models.Model):
partner_id = obj.partner_id.id
return partner_id
@api.multi
def partner_link(self):
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)

8
mass_mailing_partner/models/mail_mass_mailing.py

@ -1,10 +1,10 @@
# -*- 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).
from openerp import models, fields
from odoo import fields, models
class MailMassMailingList(models.Model):

21
mass_mailing_partner/models/mail_mass_mailing_contact.py

@ -1,11 +1,11 @@
# -*- 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).
from openerp import models, fields, api, _
from odoo import _, api, fields, models
class MailMassMailingContact(models.Model):
@ -19,7 +19,6 @@ class MailMassMailingContact(models.Model):
_('Partner already exists in this mailing list.'))
]
@api.one
@api.onchange('partner_id')
def _onchange_partner(self):
if self.partner_id:
@ -34,12 +33,12 @@ class MailMassMailingContact(models.Model):
vals = self._set_name_email(vals)
return super(MailMassMailingContact, self).create(vals)
@api.one
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)
def _prepare_partner(self, vals, mailing_list):

35
mass_mailing_partner/models/res_partner.py

@ -1,12 +1,12 @@
# -*- 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).
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):
@ -19,7 +19,8 @@ class ResPartner(models.Model):
comodel_name='mail.mass_mailing.contact', inverse_name='partner_id')
mass_mailing_contacts_count = fields.Integer(
string='Mailing list number',
compute='_compute_mass_mailing_contacts_count', store=True)
compute='_compute_mass_mailing_contacts_count', store=True,
compute_sudo=True)
mass_mailing_stats = fields.One2many(
string="Mass mailing stats",
comodel_name='mail.mail.statistics', inverse_name='partner_id')
@ -27,26 +28,26 @@ class ResPartner(models.Model):
string='Mass mailing stats number',
compute='_compute_mass_mailing_stats_count', store=True)
@api.one
@api.constrains('email')
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.sudo().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',
'mass_mailing_contact_ids.opt_out')
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')
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):
res = super(ResPartner, self).write(vals)
if vals.get('name') or vals.get('email'):

6
mass_mailing_partner/tests/__init__.py

@ -1,7 +1,7 @@
# -*- 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).
from . import test_mail_mass_mailing_contact, test_res_partner

8
mass_mailing_partner/tests/base.py

@ -1,10 +1,10 @@
# -*- 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).
from openerp.tests.common import TransactionCase
from odoo.tests.common import TransactionCase
class BaseCase(TransactionCase):

4
mass_mailing_partner/tests/test_mail_mail_statistics.py

@ -1,5 +1,7 @@
# -*- 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).
from . import base

6
mass_mailing_partner/tests/test_mail_mass_mailing_contact.py

@ -1,7 +1,7 @@
# -*- 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).
from . import base

8
mass_mailing_partner/tests/test_partner_mail_list_wizard.py

@ -1,11 +1,11 @@
# -*- 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).
from . import base
from openerp.exceptions import Warning as UserError
from odoo.exceptions import UserError
class PartnerMailListWizardCase(base.BaseCase):

8
mass_mailing_partner/tests/test_res_partner.py

@ -1,11 +1,11 @@
# -*- 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).
from . import base
from openerp.exceptions import ValidationError
from odoo.exceptions import ValidationError
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"?>
<!-- © 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). -->
<openerp>
<data>
<odoo>
<record model="ir.ui.view" id="view_mail_mail_statistics_form">
<field name="name">Add partner field</field>
@ -42,5 +41,4 @@
</field>
</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"?>
<!-- © 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). -->
<openerp>
<data>
<odoo>
<record model="ir.ui.view" id="view_mail_mass_mailing_contact_tree">
<field name="name">mail.mass_mailing.contact.tree.partner</field>
@ -40,5 +39,4 @@
</field>
</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"?>
<!-- © 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). -->
<openerp>
<data>
<odoo>
<record model="ir.ui.view" id="view_mail_mass_mailing_list_form">
<field name="name">mail.mass_mailing.list.form</field>
@ -22,5 +21,4 @@
</field>
</record>
</data>
</openerp>
</odoo>

18
mass_mailing_partner/views/res_partner_view.xml

@ -1,18 +1,18 @@
<?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). -->
<openerp>
<data>
<odoo>
<record model="ir.ui.view" id="view_partner_form">
<field name="name">Partner Form with mailing contacts</field>
<field name="model">res.partner</field>
<field name="inherit_id" ref="base.view_partner_form"/>
<field name="groups_id" eval="[(4, ref('mass_mailing.group_mass_mailing_user'))]"/>
<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"
context="{'search_default_partner_id': active_id,
'default_partner_id': active_id}"
@ -41,6 +41,7 @@
<field name="name">Partner Search with mailing contacts</field>
<field name="model">res.partner</field>
<field name="inherit_id" ref="base.view_res_partner_filter"/>
<field name="groups_id" eval="[(4, ref('mass_mailing.group_mass_mailing_user'))]"/>
<field name="priority">20</field>
<field name="arch" type="xml">
<field name="category_id" position="after">
@ -50,5 +51,4 @@
</field>
</record>
</data>
</openerp>
</odoo>

6
mass_mailing_partner/wizard/__init__.py

@ -1,7 +1,7 @@
# -*- 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).
from . import partner_mail_list_wizard

10
mass_mailing_partner/wizard/partner_mail_list_wizard.py

@ -1,11 +1,11 @@
# -*- 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).
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):

13
mass_mailing_partner/wizard/partner_mail_list_wizard.xml

@ -1,10 +1,9 @@
<?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). -->
<openerp>
<data>
<odoo>
<act_window name="Add to mailing list"
res_model="partner.mail.list.wizard"
@ -25,12 +24,10 @@
<footer>
<button string="Add contacts to mailing list" name="add_to_mail_list"
type="object" class="oe_highlight"/>
or
<button string="Cancel" class="oe_link" special="cancel" />
</footer>
</form>
</field>
</record>
</data>
</openerp>
</odoo>
Loading…
Cancel
Save