[IMP] mail: improve the tree view of the <mail.mail>

Purpose
=======
Show the state of the <mail.mail> in the tree view and color only the
badge widget instead of the entire row.

Fix a typo in the help of the scheduled_date field on mail template.

Task-2587345

Part-of: odoo/odoo#73271
This commit is contained in:
std-odoo
2022-05-31 14:58:53 +02:00
parent 33965afa5e
commit 94a372dee7
2 changed files with 6 additions and 4 deletions
+1 -1
View File
@@ -61,7 +61,7 @@ class MailTemplate(models.Model):
mail_server_id = fields.Many2one('ir.mail_server', 'Outgoing Mail Server', readonly=False,
help="Optional preferred server for outgoing mails. If not set, the highest "
"priority one will be used.")
scheduled_date = fields.Char('Scheduled Date', help="If set, the queue manager will send the email after the date. If not set, the email will be send as soon as possible. You can use dynamic expressions expression.")
scheduled_date = fields.Char('Scheduled Date', help="If set, the queue manager will send the email after the date. If not set, the email will be send as soon as possible. You can use dynamic expression.")
auto_delete = fields.Boolean(
'Auto Delete', default=True,
help="This option permanently removes any track of email after it's been sent, including from the Technical menu in the Settings, in order to preserve storage space of your Odoo database.")
+5 -3
View File
@@ -29,7 +29,8 @@
<group>
<field name="email_from"/>
<field name="email_to"/>
<field name="recipient_ids" widget="many2many_tags"/>
<field name="recipient_ids" widget="many2many_tags"
domain="[('type', '!=', 'private'), ('active', '=', True)]"/>
<field name="email_cc"/>
<field name="reply_to"/>
<field name="scheduled_date"/>
@@ -77,7 +78,7 @@
<field name="name">mail.mail.tree</field>
<field name="model">mail.mail</field>
<field name="arch" type="xml">
<tree string="Emails" decoration-muted="state in ('sent', 'cancel')" decoration-info="state=='outgoing'" decoration-danger="state=='exception'">
<tree string="Emails">
<header>
<button name="action_retry" string="Retry" type="object"/>
</header>
@@ -89,8 +90,9 @@
<field name="model" invisible="1"/>
<field name="res_id" invisible="1"/>
<field name="email_from" invisible="1"/>
<field name="state" invisible="1"/>
<field name="message_type" invisible="1"/>
<field name="state" widget="badge" decoration-muted="state in ('sent', 'cancel')"
decoration-info="state=='outgoing'" decoration-danger="state=='exception'"/>
<button name="send" string="Send Now" type="object" icon="fa-paper-plane" states='outgoing'/>
<button name="mark_outgoing" string="Retry" type="object" icon="fa-repeat" states='exception,cancel'/>
<button name="cancel" string="Cancel Email" type="object" icon="fa-times-circle" states='outgoing'/>