-
-
Notifications
You must be signed in to change notification settings - Fork 588
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
[ADD] mass_mailing_resend #210
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.
Minor improvements to code. Functional test OK.
@@ -0,0 +1,7 @@ | |||
# -*- coding: utf-8 -*- | |||
# Copyright 2015 Grupo ESOC Ingeniería de Servicios, S.L.U. - Jairo Llopis | |||
# Copyright 2016 Tecnativa - Vicent Cubells |
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.
Drop copyright from __init__
files
@@ -0,0 +1,20 @@ | |||
# -*- coding: utf-8 -*- | |||
# Copyright 2015 Grupo ESOC Ingeniería de Servicios, S.L.U. - Jairo Llopis | |||
# Copyright 2016 Tecnativa - Vicent Cubells |
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.
Update copyright (it seems you copied it wrongly from elsewhere)
|
||
def button_draft(self): | ||
"""Return to draft state for resending the mass mailing.""" | ||
if any(self.mapped(lambda x: x.state != '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.
if self.filtered(...):
, or use a normal for
loop, which is more performant since it would stop at 1st match.
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.
In this case, as the list is going to be very short, I prefer this formula to avoid one cyclomatic level more.
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.
In such case, use if self.filtered(...)
<field name="inherit_id" ref="mass_mailing.view_mail_mass_mailing_form"/> | ||
<field name="arch" type="xml"> | ||
<field name="state" position="before"> | ||
<button string="Resend" |
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 you think "resend" is a bit misleading? Because you are not actually "resending" it, just setting back as draft. 🤔
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.
A help
would also be useful here noting that the mail will only be sent to new recipients.
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.
I prefer resend word that is more user friendly, because setting back to draft is for resending purpose, although I'm going to add a text when clicked explaining about the new recipients.
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.
<field name="inherit_id" ref="mass_mailing.view_mail_mass_mailing_form"/> | ||
<field name="arch" type="xml"> | ||
<field name="state" position="before"> | ||
<button string="Resend" |
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.
A help
would also be useful here noting that the mail will only be sent to new recipients.
Resend mass mailings ==================== A frequent need for users of mass mailings is to resend one mailing that has already been sent in the past to new recipients that haven't received yet that mail. But the problem is to know which are the applicable ones. Odoo already includes a method in its mass mailing logic that avoids to resend the same mail 2 times for one mass mailing, and for v9, there was a trick that allows to modify the state of a mass mailing from kanban view, covering the need. But now on v10 both status bar in form view and dragging between states in kanban are not allowed. This module introduces a button to restart a mass mailing to draft state, allowing you to reevaluate the sending domain or list for performing again the mailing. Usage ===== * Go to *Mass mailing > Mailings > Mass Mailings*. * Click on one record that is done or create a new one and send it. * You will see a button called "Resend". * If you click on it, mass mailing will be set to Draft again. Known issues / Roadmap ====================== * Add an indicator / filter for knowing resent mailings. * Include information on the number of new recipients to be sent on the resending (through `get_remaining_recipients` method).
8e37dd6
to
e9a49cc
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.
Great!
@@ -12,6 +12,16 @@ | |||
type="object" | |||
/> | |||
</field> | |||
<header position="after"> | |||
<div class="alert alert-warning oe_text_center" attrs="{'invisible': ['|', ('state', '!=', 'draft'), ('sent', '=', '0')]}"> |
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.
Following the flow: shouldn't this be more like:
{'invisible': ['|', ('state', '=', 'done'), ('state', '!=', 'done'), ('sent', '=', '0')]}
So it's only visible when a mailing is reset to draft and it has sent mails. Otherwise it's visible at the first composition.
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.
No, it's correct as it's now: it's only visible when on draft and sent > 0.
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.
Isn't it when draft or sent = 0
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.
I don't get you. Please re-read my comment
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.
Ok, yeah. I got it wrong because the second condition doesn't seem to be working fine. When you create a new draft mailing the bubble is visible (maybe is False until the field is computed by the first time?)
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.
Ok, it was more subtle than that 😄 The quotes in ('sent', '=', '0')
are avoiding proper evaluation. So, this should work:
{'invisible': ['|', ('state', '!=', 'draft'), ('sent', '=', 0)]}
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.
Agh...
@pedrobaeza Can I squash and merge? |
Yes, please |
* [ADD] mass_mailing_resend Resend mass mailings ==================== A frequent need for users of mass mailings is to resend one mailing that has already been sent in the past to new recipients that haven't received yet that mail. But the problem is to know which are the applicable ones. Odoo already includes a method in its mass mailing logic that avoids to resend the same mail 2 times for one mass mailing, and for v9, there was a trick that allows to modify the state of a mass mailing from kanban view, covering the need. But now on v10 both status bar in form view and dragging between states in kanban are not allowed. This module introduces a button to restart a mass mailing to draft state, allowing you to reevaluate the sending domain or list for performing again the mailing. Usage ===== * Go to *Mass mailing > Mailings > Mass Mailings*. * Click on one record that is done or create a new one and send it. * You will see a button called "Resend". * If you click on it, mass mailing will be set to Draft again. Known issues / Roadmap ====================== * Add an indicator / filter for knowing resent mailings. * Include information on the number of new recipients to be sent on the resending (through `get_remaining_recipients` method).
* [ADD] mass_mailing_resend Resend mass mailings ==================== A frequent need for users of mass mailings is to resend one mailing that has already been sent in the past to new recipients that haven't received yet that mail. But the problem is to know which are the applicable ones. Odoo already includes a method in its mass mailing logic that avoids to resend the same mail 2 times for one mass mailing, and for v9, there was a trick that allows to modify the state of a mass mailing from kanban view, covering the need. But now on v10 both status bar in form view and dragging between states in kanban are not allowed. This module introduces a button to restart a mass mailing to draft state, allowing you to reevaluate the sending domain or list for performing again the mailing. Usage ===== * Go to *Mass mailing > Mailings > Mass Mailings*. * Click on one record that is done or create a new one and send it. * You will see a button called "Resend". * If you click on it, mass mailing will be set to Draft again. Known issues / Roadmap ====================== * Add an indicator / filter for knowing resent mailings. * Include information on the number of new recipients to be sent on the resending (through `get_remaining_recipients` method).
* [ADD] mass_mailing_resend Resend mass mailings ==================== A frequent need for users of mass mailings is to resend one mailing that has already been sent in the past to new recipients that haven't received yet that mail. But the problem is to know which are the applicable ones. Odoo already includes a method in its mass mailing logic that avoids to resend the same mail 2 times for one mass mailing, and for v9, there was a trick that allows to modify the state of a mass mailing from kanban view, covering the need. But now on v10 both status bar in form view and dragging between states in kanban are not allowed. This module introduces a button to restart a mass mailing to draft state, allowing you to reevaluate the sending domain or list for performing again the mailing. Usage ===== * Go to *Mass mailing > Mailings > Mass Mailings*. * Click on one record that is done or create a new one and send it. * You will see a button called "Resend". * If you click on it, mass mailing will be set to Draft again. Known issues / Roadmap ====================== * Add an indicator / filter for knowing resent mailings. * Include information on the number of new recipients to be sent on the resending (through `get_remaining_recipients` method).
* [ADD] mass_mailing_resend Resend mass mailings ==================== A frequent need for users of mass mailings is to resend one mailing that has already been sent in the past to new recipients that haven't received yet that mail. But the problem is to know which are the applicable ones. Odoo already includes a method in its mass mailing logic that avoids to resend the same mail 2 times for one mass mailing, and for v9, there was a trick that allows to modify the state of a mass mailing from kanban view, covering the need. But now on v10 both status bar in form view and dragging between states in kanban are not allowed. This module introduces a button to restart a mass mailing to draft state, allowing you to reevaluate the sending domain or list for performing again the mailing. Usage ===== * Go to *Mass mailing > Mailings > Mass Mailings*. * Click on one record that is done or create a new one and send it. * You will see a button called "Resend". * If you click on it, mass mailing will be set to Draft again. Known issues / Roadmap ====================== * Add an indicator / filter for knowing resent mailings. * Include information on the number of new recipients to be sent on the resending (through `get_remaining_recipients` method).
* [ADD] mass_mailing_resend Resend mass mailings ==================== A frequent need for users of mass mailings is to resend one mailing that has already been sent in the past to new recipients that haven't received yet that mail. But the problem is to know which are the applicable ones. Odoo already includes a method in its mass mailing logic that avoids to resend the same mail 2 times for one mass mailing, and for v9, there was a trick that allows to modify the state of a mass mailing from kanban view, covering the need. But now on v10 both status bar in form view and dragging between states in kanban are not allowed. This module introduces a button to restart a mass mailing to draft state, allowing you to reevaluate the sending domain or list for performing again the mailing. Usage ===== * Go to *Mass mailing > Mailings > Mass Mailings*. * Click on one record that is done or create a new one and send it. * You will see a button called "Resend". * If you click on it, mass mailing will be set to Draft again. Known issues / Roadmap ====================== * Add an indicator / filter for knowing resent mailings. * Include information on the number of new recipients to be sent on the resending (through `get_remaining_recipients` method).
* [ADD] mass_mailing_resend Resend mass mailings ==================== A frequent need for users of mass mailings is to resend one mailing that has already been sent in the past to new recipients that haven't received yet that mail. But the problem is to know which are the applicable ones. Odoo already includes a method in its mass mailing logic that avoids to resend the same mail 2 times for one mass mailing, and for v9, there was a trick that allows to modify the state of a mass mailing from kanban view, covering the need. But now on v10 both status bar in form view and dragging between states in kanban are not allowed. This module introduces a button to restart a mass mailing to draft state, allowing you to reevaluate the sending domain or list for performing again the mailing. Usage ===== * Go to *Mass mailing > Mailings > Mass Mailings*. * Click on one record that is done or create a new one and send it. * You will see a button called "Resend". * If you click on it, mass mailing will be set to Draft again. Known issues / Roadmap ====================== * Add an indicator / filter for knowing resent mailings. * Include information on the number of new recipients to be sent on the resending (through `get_remaining_recipients` method).
* [ADD] mass_mailing_resend Resend mass mailings ==================== A frequent need for users of mass mailings is to resend one mailing that has already been sent in the past to new recipients that haven't received yet that mail. But the problem is to know which are the applicable ones. Odoo already includes a method in its mass mailing logic that avoids to resend the same mail 2 times for one mass mailing, and for v9, there was a trick that allows to modify the state of a mass mailing from kanban view, covering the need. But now on v10 both status bar in form view and dragging between states in kanban are not allowed. This module introduces a button to restart a mass mailing to draft state, allowing you to reevaluate the sending domain or list for performing again the mailing. Usage ===== * Go to *Mass mailing > Mailings > Mass Mailings*. * Click on one record that is done or create a new one and send it. * You will see a button called "Resend". * If you click on it, mass mailing will be set to Draft again. Known issues / Roadmap ====================== * Add an indicator / filter for knowing resent mailings. * Include information on the number of new recipients to be sent on the resending (through `get_remaining_recipients` method).
* [ADD] mass_mailing_resend Resend mass mailings ==================== A frequent need for users of mass mailings is to resend one mailing that has already been sent in the past to new recipients that haven't received yet that mail. But the problem is to know which are the applicable ones. Odoo already includes a method in its mass mailing logic that avoids to resend the same mail 2 times for one mass mailing, and for v9, there was a trick that allows to modify the state of a mass mailing from kanban view, covering the need. But now on v10 both status bar in form view and dragging between states in kanban are not allowed. This module introduces a button to restart a mass mailing to draft state, allowing you to reevaluate the sending domain or list for performing again the mailing. Usage ===== * Go to *Mass mailing > Mailings > Mass Mailings*. * Click on one record that is done or create a new one and send it. * You will see a button called "Resend". * If you click on it, mass mailing will be set to Draft again. Known issues / Roadmap ====================== * Add an indicator / filter for knowing resent mailings. * Include information on the number of new recipients to be sent on the resending (through `get_remaining_recipients` method).
* [ADD] mass_mailing_resend Resend mass mailings ==================== A frequent need for users of mass mailings is to resend one mailing that has already been sent in the past to new recipients that haven't received yet that mail. But the problem is to know which are the applicable ones. Odoo already includes a method in its mass mailing logic that avoids to resend the same mail 2 times for one mass mailing, and for v9, there was a trick that allows to modify the state of a mass mailing from kanban view, covering the need. But now on v10 both status bar in form view and dragging between states in kanban are not allowed. This module introduces a button to restart a mass mailing to draft state, allowing you to reevaluate the sending domain or list for performing again the mailing. Usage ===== * Go to *Mass mailing > Mailings > Mass Mailings*. * Click on one record that is done or create a new one and send it. * You will see a button called "Resend". * If you click on it, mass mailing will be set to Draft again. Known issues / Roadmap ====================== * Add an indicator / filter for knowing resent mailings. * Include information on the number of new recipients to be sent on the resending (through `get_remaining_recipients` method).
* [ADD] mass_mailing_resend Resend mass mailings ==================== A frequent need for users of mass mailings is to resend one mailing that has already been sent in the past to new recipients that haven't received yet that mail. But the problem is to know which are the applicable ones. Odoo already includes a method in its mass mailing logic that avoids to resend the same mail 2 times for one mass mailing, and for v9, there was a trick that allows to modify the state of a mass mailing from kanban view, covering the need. But now on v10 both status bar in form view and dragging between states in kanban are not allowed. This module introduces a button to restart a mass mailing to draft state, allowing you to reevaluate the sending domain or list for performing again the mailing. Usage ===== * Go to *Mass mailing > Mailings > Mass Mailings*. * Click on one record that is done or create a new one and send it. * You will see a button called "Resend". * If you click on it, mass mailing will be set to Draft again. Known issues / Roadmap ====================== * Add an indicator / filter for knowing resent mailings. * Include information on the number of new recipients to be sent on the resending (through `get_remaining_recipients` method).
* [ADD] mass_mailing_resend Resend mass mailings ==================== A frequent need for users of mass mailings is to resend one mailing that has already been sent in the past to new recipients that haven't received yet that mail. But the problem is to know which are the applicable ones. Odoo already includes a method in its mass mailing logic that avoids to resend the same mail 2 times for one mass mailing, and for v9, there was a trick that allows to modify the state of a mass mailing from kanban view, covering the need. But now on v10 both status bar in form view and dragging between states in kanban are not allowed. This module introduces a button to restart a mass mailing to draft state, allowing you to reevaluate the sending domain or list for performing again the mailing. Usage ===== * Go to *Mass mailing > Mailings > Mass Mailings*. * Click on one record that is done or create a new one and send it. * You will see a button called "Resend". * If you click on it, mass mailing will be set to Draft again. Known issues / Roadmap ====================== * Add an indicator / filter for knowing resent mailings. * Include information on the number of new recipients to be sent on the resending (through `get_remaining_recipients` method).
* [ADD] mass_mailing_resend Resend mass mailings ==================== A frequent need for users of mass mailings is to resend one mailing that has already been sent in the past to new recipients that haven't received yet that mail. But the problem is to know which are the applicable ones. Odoo already includes a method in its mass mailing logic that avoids to resend the same mail 2 times for one mass mailing, and for v9, there was a trick that allows to modify the state of a mass mailing from kanban view, covering the need. But now on v10 both status bar in form view and dragging between states in kanban are not allowed. This module introduces a button to restart a mass mailing to draft state, allowing you to reevaluate the sending domain or list for performing again the mailing. Usage ===== * Go to *Mass mailing > Mailings > Mass Mailings*. * Click on one record that is done or create a new one and send it. * You will see a button called "Resend". * If you click on it, mass mailing will be set to Draft again. Known issues / Roadmap ====================== * Add an indicator / filter for knowing resent mailings. * Include information on the number of new recipients to be sent on the resending (through `get_remaining_recipients` method).
* [ADD] mass_mailing_resend Resend mass mailings ==================== A frequent need for users of mass mailings is to resend one mailing that has already been sent in the past to new recipients that haven't received yet that mail. But the problem is to know which are the applicable ones. Odoo already includes a method in its mass mailing logic that avoids to resend the same mail 2 times for one mass mailing, and for v9, there was a trick that allows to modify the state of a mass mailing from kanban view, covering the need. But now on v10 both status bar in form view and dragging between states in kanban are not allowed. This module introduces a button to restart a mass mailing to draft state, allowing you to reevaluate the sending domain or list for performing again the mailing. Usage ===== * Go to *Mass mailing > Mailings > Mass Mailings*. * Click on one record that is done or create a new one and send it. * You will see a button called "Resend". * If you click on it, mass mailing will be set to Draft again. Known issues / Roadmap ====================== * Add an indicator / filter for knowing resent mailings. * Include information on the number of new recipients to be sent on the resending (through `get_remaining_recipients` method).
* [ADD] mass_mailing_resend Resend mass mailings ==================== A frequent need for users of mass mailings is to resend one mailing that has already been sent in the past to new recipients that haven't received yet that mail. But the problem is to know which are the applicable ones. Odoo already includes a method in its mass mailing logic that avoids to resend the same mail 2 times for one mass mailing, and for v9, there was a trick that allows to modify the state of a mass mailing from kanban view, covering the need. But now on v10 both status bar in form view and dragging between states in kanban are not allowed. This module introduces a button to restart a mass mailing to draft state, allowing you to reevaluate the sending domain or list for performing again the mailing. Usage ===== * Go to *Mass mailing > Mailings > Mass Mailings*. * Click on one record that is done or create a new one and send it. * You will see a button called "Resend". * If you click on it, mass mailing will be set to Draft again. Known issues / Roadmap ====================== * Add an indicator / filter for knowing resent mailings. * Include information on the number of new recipients to be sent on the resending (through `get_remaining_recipients` method).
* [ADD] mass_mailing_resend Resend mass mailings ==================== A frequent need for users of mass mailings is to resend one mailing that has already been sent in the past to new recipients that haven't received yet that mail. But the problem is to know which are the applicable ones. Odoo already includes a method in its mass mailing logic that avoids to resend the same mail 2 times for one mass mailing, and for v9, there was a trick that allows to modify the state of a mass mailing from kanban view, covering the need. But now on v10 both status bar in form view and dragging between states in kanban are not allowed. This module introduces a button to restart a mass mailing to draft state, allowing you to reevaluate the sending domain or list for performing again the mailing. Usage ===== * Go to *Mass mailing > Mailings > Mass Mailings*. * Click on one record that is done or create a new one and send it. * You will see a button called "Resend". * If you click on it, mass mailing will be set to Draft again. Known issues / Roadmap ====================== * Add an indicator / filter for knowing resent mailings. * Include information on the number of new recipients to be sent on the resending (through `get_remaining_recipients` method).
* [ADD] mass_mailing_resend Resend mass mailings ==================== A frequent need for users of mass mailings is to resend one mailing that has already been sent in the past to new recipients that haven't received yet that mail. But the problem is to know which are the applicable ones. Odoo already includes a method in its mass mailing logic that avoids to resend the same mail 2 times for one mass mailing, and for v9, there was a trick that allows to modify the state of a mass mailing from kanban view, covering the need. But now on v10 both status bar in form view and dragging between states in kanban are not allowed. This module introduces a button to restart a mass mailing to draft state, allowing you to reevaluate the sending domain or list for performing again the mailing. Usage ===== * Go to *Mass mailing > Mailings > Mass Mailings*. * Click on one record that is done or create a new one and send it. * You will see a button called "Resend". * If you click on it, mass mailing will be set to Draft again. Known issues / Roadmap ====================== * Add an indicator / filter for knowing resent mailings. * Include information on the number of new recipients to be sent on the resending (through `get_remaining_recipients` method).
Resend mass mailings
A frequent need for users of mass mailings is to resend one mailing that has already been sent in the past to new recipients that haven't received yet that mail. But the problem is to know which are the applicable ones.
Odoo already includes a method in its mass mailing logic that avoids to resend the same mail 2 times for one mass mailing, and for v9, there was a trick that allows to modify the state of a mass mailing from kanban view, covering the need.
But now on v10 both status bar in form view and dragging between states in kanban are not allowed.
This module introduces a button to restart a mass mailing to draft state, allowing you to reevaluate the sending domain or list for performing again the mailing.
Usage
Known issues / Roadmap
resending (through
get_remaining_recipients
method).@Tecnativa