-
-
Notifications
You must be signed in to change notification settings - Fork 587
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[MIG] mass_mailing_partner: Migration to 10.0 #171
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please clean up commit history
b691054
to
0c16dac
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add your copyright in the files you touch and check Travis status. It should be green.
mass_mailing_partner/README.rst
Outdated
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This note can be removed and it doesn't apply anymore.
mass_mailing_partner/README.rst
Outdated
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**>`_. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove this part according new README template
mass_mailing_partner/README.rst
Outdated
`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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove this unneeded section
mass_mailing_partner/__manifest__.py
Outdated
"name": "Link partners with mass-mailing", | ||
"version": "10.0.1.0.0", | ||
"author": "Tecnativa, " | ||
"Antiun Ingeniería S.L., " |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove Antiun and Serv. Tecnol. ...
_('Partner already exists in this mailing list.')) | ||
] | ||
|
||
@api.one |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't put @api.one
here.
vals = self._set_name_email(vals) | ||
return super(MailMassMailingContact, self).create(vals) | ||
|
||
@api.one |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rewrite the method to be @api.multi
or this will hit performance.
_("This partner '%s' is subscribed to one or more " | ||
"mailing lists. Email must be assigned." % self.name)) | ||
|
||
@api.one |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rewrite it for @api.multi
def _compute_mass_mailing_contacts_count(self): | ||
self.mass_mailing_contacts_count = len(self.mass_mailing_contact_ids) | ||
|
||
@api.one |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make it @api.multi
@api.multi | ||
@api.depends('mass_mailing_stats') | ||
def _compute_mass_mailing_stats_count(self): | ||
self.mass_mailing_stats_count = len(self.mass_mailing_stats) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs a for
loop
@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) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs a for
loop
fa6fa72
to
17da5df
Compare
@pedrobaeza @yajo Changes done. Travis is failing on |
@@ -0,0 +1,140 @@ | |||
# Translation of Odoo Server. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file should not exist
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)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The string modulo must be after the translation, not before.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@yajo I'm not sure about what you mean here 😕
<footer> | ||
<button string="Add contacts to mailing list" name="add_to_mail_list" | ||
type="object" class="oe_highlight"/> | ||
or |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove the or
@yajo @pedrobaeza Changes done |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code review
e1bdf9b
to
66a1ff2
Compare
Please check errors |
66a1ff2
to
5c095f6
Compare
@pedrobaeza Errors seem to be unrelated. Rebasing to rebuild tests and see. |
@pedrobaeza Well, this is runbot's log now 😕
|
Uhm, right, please try to fix main branch in other PR. |
[IMP] mass_mailing_partner: Link mail statistics to partner
[FIX][mass_mailing_partner] Exclude opt_out. Now opted-out records will not be counted in the "Mailing lists" smart button in the partner form.
By indicating the exact `partner_id` and ensuring no contacts associated to it are found, you avoid possible duplication errors when several partners share the same name or email.
f364baf
to
6a88a09
Compare
@pedrobaeza It's all green now |
fe638e9
to
2837986
Compare
cc @Tecnativa