[FIX] mass_mailing: hide action buttons in 'sending' state

Before this commit:
In a mass mailing, the action buttons such as 'put_in_queue' (Send) and
'action_schedule_date' (Schedule) are visible in 'sending' state, which
is not correct because users should not be able re-launch it in sending
state.

After this commit:
We hide those action button in 'sending' state to prevent user from
re-launching mass mailing when it's already in queue.

Task-Id : 2469352

closes odoo/odoo#67446

X-original-commit: 2b874486266e14e81ee93b61c402b4d14dc9a225
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
This commit is contained in:
aaj-odoo
2021-03-08 10:00:38 +00:00
committed by Thibault Delavallée
parent 32a82def4f
commit 80de2a8894
@@ -57,10 +57,10 @@
<form string="Mailing">
<header style="min-height:31px;">
<button name="action_launch" type="object" class="oe_highlight" string="Launch"
attrs="{'invisible': ['|', ('state', 'in', ('in_queue', 'done')), ('schedule_type', '=', 'scheduled')]}"
attrs="{'invisible': ['|', ('state', 'in', ('in_queue', 'sending', 'done')), ('schedule_type', '=', 'scheduled')]}"
confirm="This will send the email to all recipients. Do you still want to proceed ?"/>
<button name="action_schedule" type="object" class="oe_highlight" string="Schedule"
attrs="{'invisible': ['|', ('state', 'in', ('in_queue', 'done')), ('schedule_type', '=', 'now')]}"/>
attrs="{'invisible': ['|', ('state', 'in', ('in_queue', 'sending', 'done')), ('schedule_type', '=', 'now')]}"/>
<button name="action_test" type="object" class="btn-secondary" string="Test"/>
<button name="action_cancel" type="object" attrs="{'invisible': [('state', '!=', 'in_queue')]}" class="btn-secondary" string="Cancel"/>
<button name="action_retry_failed" type="object" attrs="{'invisible': ['|', ('state', '!=', 'done'), ('failed', '=', 0)]}" class="oe_highlight" string="Retry"/>