Skip to content

Commit dfa8673

Browse files
Bertrand2tde-banana-odoo
authored andcommitted
[IMP] mail, various: improve mail template usability
Allow our users to modify mail template more easily - make the list accessible from the settings - give them a link to update relevant views to update header/footer - make the list and form of templates more readable - add a description on templates, allowing to describe their usage In order to better filter templates, a new category field is added that is computed based on active flag, description being set and the template having an xml ID. Master templates are active, with a description and an xml ID. Update master data to add description on some templates. task-2944770 closes odoo#101399 Related: odoo/enterprise#31916 Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
1 parent 1e9db93 commit dfa8673

File tree

44 files changed

+274
-143
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+274
-143
lines changed

addons/account/data/mail_template_data.xml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,12 @@
66
<data noupdate="1">
77
<!--Email template -->
88
<record id="email_template_edi_invoice" model="mail.template">
9-
<field name="name">Invoice: Send by email</field>
9+
<field name="name">Invoice: Sending</field>
1010
<field name="model_id" ref="account.model_account_move"/>
1111
<field name="email_from">{{ (object.invoice_user_id.email_formatted or user.email_formatted) }}</field>
1212
<field name="partner_to">{{ object.partner_id.id }}</field>
1313
<field name="subject">{{ object.company_id.name }} Invoice (Ref {{ object.name or 'n/a' }})</field>
14+
<field name="description">Sent to customers with their invoices in attachment</field>
1415
<field name="body_html" type="html">
1516
<div style="margin: 0px; padding: 0px;">
1617
<p style="margin: 0px; padding: 0px; font-size: 13px;">
@@ -60,10 +61,11 @@
6061
</record>
6162

6263
<record id="mail_template_data_payment_receipt" model="mail.template">
63-
<field name="name">Payment Receipt: Send by email</field>
64+
<field name="name">Payment: Payment Receipt</field>
6465
<field name="model_id" ref="account.model_account_payment"/>
6566
<field name="subject">{{ object.company_id.name }} Payment Receipt (Ref {{ object.name or 'n/a' }})</field>
6667
<field name="partner_to">{{ object.partner_id.id }}</field>
68+
<field name="description">Sent manually to customer when clicking on 'Send receipt by email' in payment action</field>
6769
<field name="body_html" type="html">
6870
<div style="margin: 0px; padding: 0px;">
6971
<p style="margin: 0px; padding: 0px; font-size: 13px;">
@@ -89,11 +91,12 @@
8991
</record>
9092
<!-- Credit note template -->
9193
<record id="email_template_edi_credit_note" model="mail.template">
92-
<field name="name">Credit note: Send by email</field>
94+
<field name="name">Credit Note: Sending</field>
9395
<field name="model_id" ref="account.model_account_move"/>
9496
<field name="email_from">{{ (object.invoice_user_id.email_formatted or user.email_formatted) }}</field>
9597
<field name="partner_to">{{ object.partner_id.id }}</field>
9698
<field name="subject">{{ object.company_id.name }} Credit Note (Ref {{ object.name or 'n/a' }})</field>
99+
<field name="description">Sent to customers with the credit note in attachment</field>
97100
<field name="body_html" type="html">
98101
<div style="margin: 0px; padding: 0px;">
99102
<p style="margin: 0px; padding: 0px; font-size: 13px;">

addons/auth_signup/data/mail_template_data.xml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,12 @@
33
<data noupdate="1">
44
<!-- Email template for reset password -->
55
<record id="reset_password_email" model="mail.template">
6-
<field name="name">Auth Signup: Reset Password</field>
6+
<field name="name">Settings: User Reset Password</field>
77
<field name="model_id" ref="base.model_res_users"/>
88
<field name="subject">Password reset</field>
99
<field name="email_from">"{{ object.company_id.name }}" &lt;{{ (object.company_id.email or user.email) }}&gt;</field>
1010
<field name="email_to">{{ object.email_formatted }}</field>
11+
<field name="description">Sent to user who requested a password reset</field>
1112
<field name="body_html" type="html">
1213
<table border="0" cellpadding="0" cellspacing="0" style="padding-top: 16px; background-color: #FFFFFF; font-family:Verdana, Arial,sans-serif; color: #454748; width: 100%; border-collapse:separate;"><tr><td align="center">
1314
<table border="0" cellpadding="0" cellspacing="0" width="590" style="padding: 16px; background-color: #FFFFFF; color: #454748; border-collapse:separate;">
@@ -98,11 +99,12 @@
9899

99100
<!-- Email template for new users -->
100101
<record id="set_password_email" model="mail.template">
101-
<field name="name">Auth Signup: Odoo Connection</field>
102+
<field name="name">Settings: New Portal Signup</field>
102103
<field name="model_id" ref="base.model_res_users"/>
103104
<field name="subject">{{ object.create_uid.name }} from {{ object.company_id.name }} invites you to connect to Odoo</field>
104105
<field name="email_from">"{{ object.company_id.name }}" &lt;{{ (object.company_id.email or user.email) }}&gt;</field>
105106
<field name="email_to">{{ object.email_formatted }}</field>
107+
<field name="description">Sent to new user after you invited them</field>
106108
<field name="body_html" type="html">
107109
<table border="0" cellpadding="0" cellspacing="0" style="padding-top: 16px; background-color: #FFFFFF; font-family:Verdana, Arial,sans-serif; color: #454748; width: 100%; border-collapse:separate;"><tr><td align="center">
108110
<table border="0" cellpadding="0" cellspacing="0" width="590" style="padding: 16px; background-color: #FFFFFF; color: #454748; border-collapse:separate;">
@@ -193,11 +195,12 @@
193195

194196
<!-- Email template for reminder of unregistered users -->
195197
<record id="mail_template_data_unregistered_users" model="mail.template">
196-
<field name="name">Auth Signup: Unregistered Users</field>
198+
<field name="name">Settings: Unregistered User Reminder</field>
197199
<field name="model_id" ref="base.model_res_users"/>
198200
<field name="subject">Reminder for unregistered users</field>
199201
<field name="email_from">{{ object.company_id.partner_id.email_formatted }}</field>
200202
<field name="email_to">{{ object.email_formatted }}</field>
203+
<field name="description">Sent automatically to admin if new user haven't responded to the invitation</field>
201204
<field name="body_html" type="html">
202205
<table border="0" cellpadding="0" cellspacing="0" style="background-color: #FFFFFF; font-family:Verdana, Arial,sans-serif; color: #454748; width: 100%; border-collapse:separate;"><tr><td align="center">
203206
<table border="0" cellpadding="0" cellspacing="0" width="590" style="padding: 16px; background-color: #FFFFFF; color: #454748; border-collapse:separate;">
@@ -244,11 +247,12 @@
244247

245248
<!-- Email template for new users that used a signup token -->
246249
<record id="mail_template_user_signup_account_created" model="mail.template">
247-
<field name="name">Auth Signup: Odoo Account Created</field>
250+
<field name="name">Settings: New User Invite</field>
248251
<field name="model_id" ref="base.model_res_users"/>
249252
<field name="subject">Welcome to {{ object.company_id.name }}!</field>
250253
<field name="email_from">"{{ object.company_id.name }}" &lt;{{ (object.company_id.email or user.email) }}&gt;</field>
251254
<field name="email_to">{{ object.email_formatted }}</field>
255+
<field name="description">Sent to portal user who registered themselves</field>
252256
<field name="body_html" type="html">
253257
<table border="0" cellpadding="0" cellspacing="0" style="padding-top: 16px; background-color: #FFFFFF; font-family:Verdana, Arial,sans-serif; color: #454748; width: 100%; border-collapse:separate;"><tr><td align="center">
254258
<table border="0" cellpadding="0" cellspacing="0" width="590" style="padding: 16px; background-color: #FFFFFF; color: #454748; border-collapse:separate;">

addons/auth_totp_mail/data/mail_template_data.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<odoo>
33
<data noupdate="1">
44
<record id="mail_template_totp_invite" model="mail.template">
5-
<field name="name">TOTP for users: Invite by email</field>
5+
<field name="name">Settings: 2Fa Invitation</field>
66
<field name="model_id" ref="base.model_res_users" />
77
<field name="subject">Invitation to activate two-factor authentication on your Odoo account</field>
88
<field name="partner_to">{{ object.partner_id.id }}</field>

addons/auth_totp_mail_enforce/data/mail_template_data.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<odoo>
33
<data noupdate="1">
44
<record id="mail_template_totp_mail_code" model="mail.template">
5-
<field name="name">TOTP for users: Authentication by email</field>
5+
<field name="name">Settings: 2Fa New Login</field>
66
<field name="model_id" ref="base.model_res_users" />
77
<field name="subject">Your two-factor authentication code</field>
88
<field name="email_to">{{ object.email_formatted }}</field>

addons/base_setup/views/res_config_settings_views.xml

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -91,21 +91,6 @@
9191
<button name="%(web.action_report_externalpreview)d" string="Preview Document" type="action" class="oe_link" groups="base.group_no_one"/>
9292
</div>
9393
</div>
94-
</div>
95-
</div>
96-
<div class="col-12 col-lg-6 o_setting_box" id="companies_setting">
97-
<div class="o_setting_right_pane">
98-
<field name='company_count' class="w-auto ps-1 fw-bold"/>
99-
<span class='o_form_label' attrs="{'invisible':[('company_count', '&gt;', '1')]}">
100-
Company
101-
</span>
102-
<span class='o_form_label' attrs="{'invisible':[('company_count', '&lt;=', '1')]}">
103-
Companies
104-
</span>
105-
<br/>
106-
<div class="mt8">
107-
<button name="%(base.action_res_company_form)d" icon="fa-arrow-right" type="action" string="Manage Companies" class="btn-link"/>
108-
</div>
10994
</div>
11095
<br/>
11196
<div id="inter_company" groups="base.group_multi_company" title="Configure company rules to automatically create SO/PO when one of your company sells/buys to another of your company.">
@@ -125,6 +110,21 @@
125110
</div>
126111
</div>
127112
</div>
113+
<div class="col-12 col-lg-6 o_setting_box" id="companies_setting">
114+
<div class="o_setting_right_pane">
115+
<field name='company_count' class="w-auto ps-1 fw-bold"/>
116+
<span class='o_form_label' attrs="{'invisible':[('company_count', '&gt;', '1')]}">
117+
Company
118+
</span>
119+
<span class='o_form_label' attrs="{'invisible':[('company_count', '&lt;=', '1')]}">
120+
Companies
121+
</span>
122+
<br/>
123+
<div class="mt8">
124+
<button name="%(base.action_res_company_form)d" icon="fa-arrow-right" type="action" string="Manage Companies" class="btn-link"/>
125+
</div>
126+
</div>
127+
</div>
128128
</div>
129129
</div>
130130
<div id="emails"/>

addons/calendar/data/mail_template_data.xml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
<field name="email_to">{{ ('' if object.partner_id.email and object.partner_id.email == object.email else object.email) }}</field>
1010
<field name="partner_to">{{ object.partner_id.id if object.partner_id.email and object.partner_id.email == object.email else False }}</field>
1111
<field name="lang">{{ object.partner_id.lang }}</field>
12+
<field name="description">Invitation email to new attendees</field>
1213
<field name="body_html" type="html">
1314
<div>
1415
<t t-set="colors" t-value="{'needsAction': 'grey', 'accepted': 'green', 'tentative': '#FFFF00', 'declined': 'red'}"/>
@@ -135,13 +136,14 @@
135136
</record>
136137

137138
<record id="calendar_template_meeting_changedate" model="mail.template">
138-
<field name="name">Calendar: Date updated</field>
139+
<field name="name">Calendar: Date Updated</field>
139140
<field name="model_id" ref="calendar.model_calendar_attendee"/>
140141
<field name="subject">{{ object.event_id.name }}: Date updated</field>
141142
<field name="email_from">{{ (object.event_id.user_id.email_formatted or user.email_formatted or '') }}</field>
142143
<field name="email_to">{{ ('' if object.partner_id.email and object.partner_id.email == object.email else object.email) }}</field>
143144
<field name="partner_to">{{ object.partner_id.id if object.partner_id.email and object.partner_id.email == object.email else False }}</field>
144145
<field name="lang">{{ object.partner_id.lang }}</field>
146+
<field name="description">Sent to all attendees if the schedule change</field>
145147
<field name="body_html" type="html">
146148
<div>
147149

@@ -272,6 +274,7 @@
272274
<field name="email_to">{{ ('' if object.partner_id.email and object.partner_id.email == object.email else object.email) }}</field>
273275
<field name="partner_to">{{ object.partner_id.id if object.partner_id.email and object.partner_id.email == object.email else False }}</field>
274276
<field name="lang">{{ object.partner_id.lang }}</field>
277+
<field name="description">Sent to all attendees if a reminder is set</field>
275278
<field name="body_html" type="html">
276279
<div>
277280
<t t-set="colors" t-value="{'needsAction': 'grey', 'accepted': 'green', 'tentative': '#FFFF00', 'declined': 'red'}" />
@@ -377,6 +380,7 @@
377380
<field name="email_from">{{ (object.user_id.email_formatted or user.email_formatted or '') }}</field>
378381
<field name="email_to">{{ object._get_attendee_emails() }}</field>
379382
<field name="lang">{{ object.partner_id.lang }}</field>
383+
<field name="description">Used to manually notifiy attendees</field>
380384
<field name="body_html" type="html">
381385
<div>
382386
<t t-set="colors" t-value="{'needsAction': 'grey', 'accepted': 'green', 'tentative': '#FFFF00', 'declined': 'red'}" />

addons/event/data/mail_template_data.xml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
<field name="subject">Your badge for {{ object.event_id.name }}</field>
99
<field name="email_from">{{ (object.event_id.organizer_id.email_formatted or object.event_id.user_id.email_formatted or '') }}</field>
1010
<field name="email_to">{{ (object.email and '"%s" &lt;%s&gt;' % (object.name, object.email) or object.partner_id.email_formatted or '') }}</field>
11+
<field name="description">Sent automatically to someone after they registered to an event</field>
1112
<field name="body_html" type="html">
1213
<div>
1314
Dear <t t-out="object.name or ''">Oscar Morgan</t>,<br/>
@@ -28,11 +29,12 @@
2829
</record>
2930

3031
<record id="event_subscription" model="mail.template">
31-
<field name="name">Event: Registration</field>
32+
<field name="name">Event: Registration Confirmation</field>
3233
<field name="model_id" ref="event.model_event_registration"/>
3334
<field name="subject">Your registration at {{ object.event_id.name }}</field>
3435
<field name="email_from">{{ (object.event_id.organizer_id.email_formatted or object.event_id.user_id.email_formatted or '') }}</field>
3536
<field name="email_to">{{ (object.email and '"%s" &lt;%s&gt;' % (object.name, object.email) or object.partner_id.email_formatted or '') }}</field>
37+
<field name="description">Sent to attendees after registering to an event</field>
3638
<field name="body_html" type="html">
3739
<table border="0" cellpadding="0" cellspacing="0" style="padding-top: 16px; background-color: #F1F1F1; font-family:Verdana, Arial,sans-serif; color: #454748; width: 100%; border-collapse:separate;"><tr><td align="center">
3840
<t t-set="date_begin" t-value="format_datetime(object.event_id.date_begin, tz='UTC', dt_format=&quot;yyyyMMdd'T'HHmmss'Z'&quot;)"/>
@@ -262,6 +264,7 @@
262264
<field name="subject">{{ object.event_id.name }}: {{ object.get_date_range_str() }}</field>
263265
<field name="email_from">{{ (object.event_id.organizer_id.email_formatted or object.event_id.user_id.email_formatted or '') }}</field>
264266
<field name="email_to">{{ (object.email and '"%s" &lt;%s&gt;' % (object.name, object.email) or object.partner_id.email_formatted or '') }}</field>
267+
<field name="description">Sent automatically to attendees if there is a reminder defined on the event</field>
265268
<field name="body_html" type="html">
266269
<table border="0" cellpadding="0" cellspacing="0" style="padding-top: 16px; background-color: #F1F1F1; font-family:Verdana, Arial,sans-serif; color: #454748; width: 100%; border-collapse:separate;"><tr><td align="center">
267270
<t t-set="date_begin" t-value="format_datetime(object.event_id.date_begin, tz='UTC', dt_format=&quot;yyyyMMdd'T'HHmmss'Z'&quot;)"/>

addons/gamification/data/mail_template_data.xml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,11 @@
22
<odoo>
33
<data noupdate="1">
44
<record id="email_template_badge_received" model="mail.template">
5-
<field name="name">Received Badge</field>
5+
<field name="name">Gamification: Badge Received</field>
66
<field name="subject">New badge {{ object.badge_id.name }} granted</field>
77
<field name="model_id" ref="gamification.model_gamification_badge_user"/>
88
<field name="partner_to">{{ object.user_id.partner_id.id }}</field>
9+
<field name="description">Sent automatically to the user who received a badge</field>
910
<field name="body_html" type="html">
1011
<table border="0" cellpadding="0" style="padding-top: 16px; background-color: #F1F1F1; color: #454748; width: 100%; border-collapse:separate;"><tr><td align="center">
1112
<table border="0" width="590" cellpadding="0" style="padding: 16px; background-color: white; color: #454748; border-collapse:separate;" summary="o_mail_notification">
@@ -100,9 +101,10 @@
100101
</record>
101102

102103
<record id="email_template_goal_reminder" model="mail.template">
103-
<field name="name">Goal: Reminder for Goal Update</field>
104+
<field name="name">Gamification: Reminder For Goal Update</field>
104105
<field name="model_id" ref="gamification.model_gamification_goal"/>
105106
<field name="partner_to">{{ object.user_id.partner_id.id }}</field>
107+
<field name="description">Sent automatically to participant who haven't updated their goal</field>
106108
<field name="body_html" type="html">
107109
<div>
108110
<strong>Reminder</strong><br/>
@@ -119,8 +121,9 @@
119121
</record>
120122

121123
<record id="simple_report_template" model="mail.template">
122-
<field name="name">Challenge: Simple Challenge Report Progress</field>
124+
<field name="name">Gamification: Challenge Report</field>
123125
<field name="model_id" ref="gamification.model_gamification_challenge"/>
126+
<field name="description">Send a challenge report to all participants</field>
124127
<field name="body_html" type="html">
125128
<table cellspacing="0" cellpadding="0" width="100%" style="background-color: #EEE; border-collapse: collapse;">
126129
<tr>
@@ -317,11 +320,12 @@
317320
</record>
318321

319322
<record id="mail_template_data_new_rank_reached" model="mail.template">
320-
<field name="name">User: New rank reached</field>
323+
<field name="name">Gamification: New Rank Reached</field>
321324
<field name="model_id" ref="base.model_res_users"/>
322325
<field name="subject">New rank: {{ object.rank_id.name }}</field>
323326
<field name="email_to"></field>
324327
<field name="partner_to">{{ object.partner_id.id }}</field>
328+
<field name="description">Sent automatically when user reaches a new rank</field>
325329
<field name="body_html" type="html">
326330
<div style="background:#F0F0F0;color:#515166;padding:10px 0px;font-family:Arial,Helvetica,sans-serif;font-size:14px;">
327331
<table style="width:600px;margin:0px auto;background:white;border:1px solid #e1e1e1;">

0 commit comments

Comments
 (0)