1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
|
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<!-- MAILING !-->
<record model="ir.ui.view" id="view_mail_mass_mailing_search">
<field name="name">mailing.mailing.search</field>
<field name="model">mailing.mailing</field>
<field name="arch" type="xml">
<search string="Mailings">
<field name="name" string="Mailing" filter_domain="['|', ('name', 'ilike', self), ('subject', 'ilike', self)]"/>
<field name="campaign_id" string="Campaign" groups="mass_mailing.group_mass_mailing_campaign"/>
<filter string="My Mailings" name="assigned_to_me"
domain="[('user_id', '=', uid)]"
help="Mailings that are assigned to me"/>
<separator/>
<filter name="filter_sent_date" date="sent_date"/>
<separator/>
<filter name="inactive" string="Archived" domain="[('active', '=', False)]"/>
<group expand="0" string="Group By">
<filter string="Status" name="group_state" context="{'group_by': 'state'}"/>
<filter string="Sent By" name="sent_by" domain="[]" context="{'group_by': 'email_from'}"/>
<separator/>
<filter string="Sent Period" name="sent_date" domain="[]" context="{'group_by': 'sent_date'}"/>
</group>
</search>
</field>
</record>
<record model="ir.ui.view" id="view_mail_mass_mailing_tree">
<field name="name">mailing.mailing.tree</field>
<field name="model">mailing.mailing</field>
<field name="priority">10</field>
<field name="arch" type="xml">
<tree string="Mailings" sample="1">
<field name="subject" attrs="{'readonly': [('state', 'in', ('sending', 'done'))]}"/>
<field name="mailing_type" invisible="1"/>
<field name="mailing_model_id" string="Recipients"/>
<field name="user_id" widget="many2one_avatar_user"/>
<field name="schedule_date" string="Scheduled" widget="remaining_days"/>
<field name="sent_date" widget="date"/>
<field name="state" decoration-info="state == 'draft' or state == 'in_queue'" decoration-success="state == 'sending' or state == 'done'" widget="badge"/>
<field name="campaign_id" string="Campaign"
groups="mass_mailing.group_mass_mailing_campaign"/>
<field name="sent"/>
<field name="bounced_ratio" string="Bounced (%)"/>
<field name="received_ratio" string="Delivered (%)"/>
<field name="opened_ratio" string="Opened (%)"/>
<field name="clicks_ratio" string="Clicked (%)"/>
<field name="replied_ratio" string="Replied (%)"/>
</tree>
</field>
</record>
<record model="ir.ui.view" id="view_mail_mass_mailing_form">
<field name="name">mailing.mailing.form</field>
<field name="model">mailing.mailing</field>
<field name="arch" type="xml">
<form string="Mailing">
<header style="min-height:31px;">
<button name="action_put_in_queue" type="object" attrs="{'invisible': [('state', 'in', ('in_queue', 'sending', 'done'))]}" class="oe_highlight" string="Send"
confirm="This will send the email to all recipients. Do you still want to proceed ?"/>
<button name="action_schedule" type="object" attrs="{'invisible': [('state', 'in', ('in_queue', 'sending', 'done'))]}" class="btn-secondary" string="Schedule"/>
<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"/>
<field name="state" readonly="1" widget="statusbar"/>
</header>
<div class="alert alert-info text-center" role="alert" attrs="{'invisible': ['&','&','&','&',('state', '!=', 'in_queue'),('sent', '=', 0),('ignored', '=', 0),('scheduled', '=', 0),('failed', '=', 0)]}">
<div attrs="{'invisible': [('ignored', '=', 0)]}">
<button class="btn-link py-0"
name="action_view_traces_ignored"
type="object">
<strong>
<field name="ignored" class="oe_inline mr-2"/>
<span name="ignored_text">emails have been ignored and will not be sent.</span>
</strong>
</button>
</div>
<div attrs="{'invisible': [('scheduled', '=', 0)]}">
<button class="btn-link py-0"
name="action_view_traces_scheduled"
type="object">
<strong>
<field name="scheduled" class="oe_inline mr-2"/>
<span name="scheduled_text">emails are in queue and will be sent soon.</span>
</strong>
</button>
</div>
<div attrs="{'invisible': ['&', ('sent', '=', 0), ('state', 'in', ('draft', 'test', 'in_queue'))]}">
<button class="btn-link py-0"
name="action_view_traces_sent"
type="object">
<strong>
<field name="sent" class="oe_inline mr-2"/>
<span name="sent">emails have been sent.</span>
</strong>
</button>
</div>
<div attrs="{'invisible': ['|', ('state', '!=', 'done'), ('failed', '=', 0)]}">
<button class="btn-link py-0"
name="action_view_traces_failed"
type="object">
<strong>
<field name="failed" class="oe_inline mr-2"/>
<span name="failed_text">emails could not be sent.</span>
</strong>
</button>
</div>
<div attrs="{'invisible': [('state', '!=', 'in_queue')]}">
<strong>
<span name="next_departure_text">This mailing is scheduled for </span>
<field name="next_departure" class="oe_inline"/>.
</strong>
</div>
</div>
<sheet>
<div class="oe_button_box" name="button_box">
<button name="action_view_delivered"
id="button_view_delivered"
type="object"
context="{'search_default_filter_delivered': True}"
attrs="{'invisible': [('state', 'in', ('draft','test'))]}"
class="oe_stat_button">
<field name="received_ratio" string="Received" widget="percentpie"/>
</button>
<button name="action_view_opened"
type="object"
context="{'search_default_filter_opened': True}"
attrs="{'invisible': [('state', 'in', ('draft','test'))]}"
class="oe_stat_button">
<field name="opened_ratio" string="Opened" widget="percentpie"/>
</button>
<button name="action_view_clicked"
type="object"
context="{'search_default_filter_clicked': True}"
attrs="{'invisible': [('state', 'in', ('draft','test'))]}"
class="oe_stat_button">
<field name="clicks_ratio" string="Clicked" widget="percentpie"/>
</button>
<button name="action_view_replied"
type="object"
context="{'search_default_filter_replied': True}"
attrs="{'invisible': [('state', 'in', ('draft','test'))]}"
class="oe_stat_button">
<field name="replied_ratio" string="Replied" widget="percentpie"/>
</button>
<button name="action_view_bounced"
type="object"
context="{'search_default_filter_bounced': True}"
attrs="{'invisible': [('state', 'in', ('draft','test'))]}"
class="oe_stat_button">
<field name="bounced_ratio" string="Bounced" widget="percentpie"/>
</button>
</div>
<widget name="web_ribbon" title="Archived" bg_color="bg-danger" attrs="{'invisible': [('active', '=', True)]}"/>
<group>
<field name="active" invisible="1"/>
<field name="mailing_type" widget="radio" options="{'horizontal': true}" invisible="1"
attrs="{'readonly': [('state', '!=', 'draft')]}" force_save="1"/>
<field name="subject" string="Subject" attrs="{'readonly': [('state', 'in', ('sending', 'done'))]}" widget="char_emojis" placeholder="e.g. New Sale on all T-shirts"/>
<field name="preview" string="Preview Text" attrs="{'readonly': [('state', 'in', ('sending', 'done'))]}" widget="char_emojis" placeholder="e.g. Check it out before it's too late!"/>
<label for="mailing_model_id" string="Recipients"/>
<div name="mailing_model_id_container">
<div class="row">
<div class="col-xs-12 col-md-3" >
<field name="mailing_model_id" widget="selection"
attrs="{'readonly': [('state', 'in', ('sending', 'done'))]}"/>
</div>
<div attrs="{'invisible': [('mailing_model_name', '!=', 'mailing.list')]}" class="col-xs-12 col-md-9 pt-1">
<label for="contact_list_ids" string="Select mailing lists:" class="oe_edit_only"/>
<field name="contact_list_ids" widget="many2many_tags"
placeholder="Select mailing lists..." class="oe_inline"
attrs="{
'required':[('mailing_model_name','=','mailing.list')],
'readonly': [('state', 'in', ('sending', 'done'))]
}"/>
</div>
</div>
<field name="mailing_model_name" invisible="1"/>
<field name="mailing_model_real" invisible="1"/>
<div attrs="{'invisible': [('mailing_model_name', '=', 'mailing.list')]}">
<field name="mailing_domain" widget="domain" options="{'model': 'mailing_model_real'}"
attrs="{'readonly': [('state', 'in', ('sending', 'done'))]}"/>
</div>
</div>
</group>
<notebook>
<page string="Mail Body" name="mail_body">
<field name="body_html" class="oe_read_only" widget="html"
options="{'cssReadonly': 'mass_mailing.iframe_css_assets_readonly'}"/>
<field name="body_arch" class="o_mail_body oe_edit_only" widget="mass_mailing_html"
options="{
'snippets': 'mass_mailing.email_designer_snippets',
'cssEdit': 'mass_mailing.iframe_css_assets_edit',
'inline-field': 'body_html'
}" attrs="{'readonly': [('state', 'in', ('sending', 'done'))]}"/>
</page>
<page string="Dynamic Placeholder Generator"
name="dynamic_placeholder_generator"
groups="base.group_no_one">
<group>
<field name="model_object_field" attrs="{'invisible': True}"/>
<field name="model_object_field"
domain="[('model_id','=',mailing_model_real),('ttype','!=','one2many'),('ttype','!=','many2many')]"/>
<field name="sub_object" readonly="1"/>
<field name="sub_model_object_field"
domain="[('model_id','=',sub_object),('ttype','!=','one2many'),('ttype','!=','many2many')]"
attrs="{'readonly':[('sub_object','=',False)],'required':[('sub_object','!=',False)]}"/>
<field name="null_value"/>
<field name="copyvalue"/>
</group>
</page>
<page string="Settings" name="settings">
<group>
<group>
<field name="id" invisible="1"/>
<field name="name" required="False" groups="base.group_no_one" string="Name"/>
<field name="user_id" domain="[('share', '=', False)]"/>
<field name="email_from" attrs="{'readonly': [('state', 'in', ('sending', 'done'))]}"/>
<label for="reply_to"/>
<div name="reply_to_details">
<field name="reply_to_mode" widget="radio"
attrs="{
'invisible': [('mailing_model_name', 'in', ['mailing.contact', 'res.partner', 'mailing.list'])],
'readonly': [('state', 'in', ('sending', 'done'))]
}"/>
<field name="reply_to"
attrs="{
'required': [('reply_to_mode', '=', 'email')],
'invisible': [('reply_to_mode', '=', 'thread')],
'readonly': [('state', 'in', ('sending', 'done'))]
}"/>
<div style="margin-top:-5px">
<small class="oe_edit_only text-muted mb-2"
style="font-size:74%"
attrs="{'invisible': ['|', ('reply_to_mode', '=', 'thread'), ('mailing_model_name', 'in', ['mailing.contact', 'res.partner', 'mailing.list'])],}">
To track replies, this address must belong to this database.
</small>
</div>
</div>
<label for="attachment_ids"/>
<div name="attachment_ids_details">
<field name="attachment_ids" widget="many2many_binary" string="Attach a file" class="oe_inline"
attrs="{'readonly': [('state', 'in', ('sending', 'done'))]}"/>
</div>
<field name="mail_server_id" groups="base.group_no_one" options="{'no_create': True, 'no_open': True}"/>
<field name="keep_archives" groups="base.group_no_one" attrs="{'readonly': [('state', 'in', ('sending', 'done'))]}"/>
</group>
<group string="Marketing" groups="base.group_no_one,mass_mailing.group_mass_mailing_campaign">
<field name="campaign_id"
string="Mailing Campaign"
groups="mass_mailing.group_mass_mailing_campaign"
attrs="{'readonly': [('state', 'in', ('sending', 'done'))],
'required': [('unique_ab_testing', '=', True)]}"/>
<field name="source_id"
string="Source"
readonly="1"
required="False"
groups="base.group_no_one"
attrs="{'readonly': [('state', 'in', ('sending', 'done'))]}"/>
<field name="medium_id"
string="Medium"
required="True"
groups="base.group_no_one"
attrs="{'readonly': [('state', 'in', ('sending', 'done'))]}"/>
<field name="unique_ab_testing"
groups="mass_mailing.group_mass_mailing_campaign"
attrs="{'readonly': [('state', 'in', ('sending', 'done'))]}"/>
<label for="contact_ab_pc" groups="mass_mailing.group_mass_mailing_campaign"/>
<div groups="mass_mailing.group_mass_mailing_campaign">
<field name="contact_ab_pc"
class="oe_inline"
attrs="{'readonly': [('state', 'in', ('sending', 'done'))]}"/> %
</div>
</group>
</group>
</page>
</notebook>
</sheet>
<div class="oe_chatter">
<field name="message_follower_ids" groups="base.group_user"/>
<field name="message_ids"/>
<field name="activity_ids"/>
</div>
</form>
</field>
</record>
<record model="ir.ui.view" id="view_mail_mass_mailing_kanban">
<field name="name">mailing.mailing.kanban</field>
<field name="model">mailing.mailing</field>
<field name="arch" type="xml">
<kanban default_group_by="state" quick_create="false" sample="1">
<field name='state' readonly="1"/>
<field name='email_from' readonly="1"/>
<field name='color'/>
<field name='user_id'/>
<field name='expected'/>
<field name='failed'/>
<field name='total'/>
<field name='mailing_model_id'/>
<field name='mailing_model_name'/>
<field name='sent_date'/>
<field name='schedule_date'/>
<field name='next_departure'/>
<field name='active'/>
<templates>
<t t-name="kanban-box">
<div t-attf-class="{{!selection_mode ? 'oe_kanban_color_' + kanban_getcolor(record.color.raw_value) : ''}} oe_kanban_card oe_kanban_global_click oe_kanban_mass_mailing">
<div class="o_dropdown_kanban dropdown" t-if="!selection_mode">
<a role="button" class="dropdown-toggle o-no-caret btn" data-toggle="dropdown" href="#" data-display="static" aria-label="Dropdown menu" title="Dropdown menu">
<span class="fa fa-ellipsis-v"/>
</a>
<div class="dropdown-menu" role="menu">
<ul class="oe_kanban_colorpicker" data-field="color"/>
<t t-if="widget.deletable">
<a role="menuitem" type="delete" class="dropdown-item">Delete</a>
</t>
<a role="menuitem" class="dropdown-item o_kanban_mailing_active" name="toggle_active" type="object">
<t t-if="record.active.raw_value">Archive</t>
<t t-if="!record.active.raw_value">Restore</t>
</a>
</div>
</div>
<div class="oe_kanban_content">
<div class="o_kanban_record_top">
<div class="o_kanban_record_headings">
<div class="row" attrs="{'invisible': [('sent_date', '=', False)]}">
<h3 class="my-1 col-8 o_text_overflow">
<field name="subject"/>
</h3>
<div class="progress border col-3 px-0 mt-2" style="background-color: inherit; height:12px;">
<div class="progress-bar" role="progressbar"
aria-valuemin="0"
t-att-aria-valuenow="record.delivered.raw_value"
t-att-aria-valuemax="record.expected.raw_value"
t-attf-style="width: #{record.delivered.raw_value * 100 / record.expected.raw_value}%"/>
</div>
</div>
<h3 class="my-1 o_text_overflow" attrs="{'invisible': [('sent_date', '!=', False)]}">
<field name="subject"/>
</h3>
<field name="mailing_type" invisible="1"/>
<div class="o_kanban_record_subtitle" attrs="{'invisible': [('sent_date', '=', False)]}">
<h5 style="display: inline;">
<field name="campaign_id" groups="mass_mailing.group_mass_mailing_campaign"/>
</h5>
</div>
</div>
</div>
<div class="o_kanban_record_body" t-if="!selection_mode" attrs="{'invisible': [('sent_date', '=', False), ('schedule_date', '=', False), ('state', '!=', 'in_queue')]}">
<div>
<span attrs="{'invisible': [('sent_date', '=', False)]}"><b><field name="delivered"/> / <field name="expected"/></b> Delivered to</span>
<span attrs="{'invisible': [('sent_date', '!=', False)]}"><b><field name='total'/></b></span>
<field name='mailing_model_id' attrs="{'invisible': [('mailing_model_name','=','mailing.list')]}"/>
<span attrs="{'invisible': [('mailing_model_name','!=','mailing.list')]}">Mailing Contact</span>
</div>
<div attrs="{'invisible': [('sent_date', '=', False)]}" class="d-flex justify-content-between">
<div name="stat_opened">
<b><field name="opened_ratio" />%</b> Opened
</div>
<div name="stat_replied">
<b><field name="replied_ratio" />%</b> Replied
</div>
<div name="stat_clicks">
<b><field name="clicks_ratio" />%</b> Clicks
</div>
</div>
</div>
</div>
<div name="div_responsible_avatar" class="o_kanban_record_bottom">
<div class="oe_kanban_bottom_left">
<span attrs="{'invisible': [('sent_date', '=', False)]}"
t-attf-title="Sent on #{record.sent_date.value}" class="d-inline-flex">
<span class="fa fa-calendar-check-o mr-2 small my-auto" aria-label="Sent date"/>
<span class="align-self-baseline"><field name="sent_date" widget="date"/></span>
</span>
<span attrs="{'invisible': [('schedule_date', '=', False)]}"
t-attf-title="Scheduled on #{record.schedule_date.value}" class="d-inline-flex">
<span class="fa fa-hourglass-half mr-2 small my-auto" aria-label="Scheduled date"/>
<span class="align-self-baseline"><field name="schedule_date" widget="date"/></span>
</span>
<span attrs="{'invisible': ['|', '|', ('sent_date', '!=', False), ('schedule_date', '!=', False), ('state', '=', 'in_queue')]}"
class="oe_clear">
<b><field name='total'/></b>
<field name='mailing_model_id' attrs="{'invisible': [('mailing_model_name','=','mailing.list')]}"/>
<span attrs="{'invisible': [('mailing_model_name','!=','mailing.list')]}">Mailing Contact</span>
</span>
<span attrs="{'invisible': ['|', '|', ('schedule_date', '!=', False), ('state', '!=', 'in_queue'), ('next_departure', '=', False)]}"
t-attf-title="Scheduled on #{record.next_departure.value}" class="d-inline-flex">
<span class="fa fa-hourglass-o mr-2 small my-auto" aria-label="Scheduled date"/>
<span class="align-self-baseline">Next Batch</span>
</span>
</div>
<div class="oe_kanban_bottom_right">
<field name="user_id" widget="many2one_avatar_user"/>
</div>
</div>
</div>
</t>
</templates>
</kanban>
</field>
</record>
<record id="view_mail_mass_mailing_graph" model="ir.ui.view">
<field name="name">mailing.mailing.graph</field>
<field name="model">mailing.mailing</field>
<field name="arch" type="xml">
<graph string="Mailing" type="bar" sample="1">
<field name="state" type="row"/>
</graph>
</field>
</record>
<record id="mailing_mailing_action_mail" model="ir.actions.act_window">
<field name="name">Mailings</field>
<field name="res_model">mailing.mailing</field>
<field name="view_mode">kanban,tree,form,graph</field>
<field name="domain">[('mailing_type', '=', 'mail')]</field>
<field name="context">{
'search_default_assigned_to_me': 1,
'default_user_id': uid,
'default_mailing_type': 'mail',
}</field>
<field name="help" type="html">
<p class="o_view_nocontent_smiling_face">
Create a new mailing
</p><p>
You don't need to import your mailing lists, you can easily
send emails<br/> to any contact saved in other Odoo apps.
</p>
</field>
</record>
<record id="action_view_mass_mailings_from_campaign" model="ir.actions.act_window">
<field name="name">Mailings</field>
<field name="res_model">mailing.mailing</field>
<field name="view_mode">kanban,tree,form</field>
<field name="context">{
'search_default_assigned_to_me': 1,
'search_default_campaign_id': [active_id],
'default_campaign_id': active_id,
'default_user_id': uid,
}
</field>
<field name="domain">[('mailing_type', '=', 'mail')]</field>
<field name="help" type="html">
<p class="o_view_nocontent_smiling_face">
Create a new mailing
</p><p>
You don't need to import your mailing lists, you can easily
send emails<br/> to any contact saved in other Odoo apps.
</p>
</field>
</record>
<record id="action_create_mass_mailings_from_campaign" model="ir.actions.act_window">
<field name="name">Mailings</field>
<field name="res_model">mailing.mailing</field>
<field name="view_mode">form,kanban,tree</field>
<field name="context">{
'search_default_assigned_to_me': 1,
'search_default_campaign_id': [active_id],
'default_campaign_id': active_id,
'default_user_id': uid,
}
</field>
<field name="help" type="html">
<p class="o_view_nocontent_smiling_face">
Create a new mailing
</p><p>
You don't need to import your mailing lists, you can easily
send emails<br/> to any contact saved in other Odoo apps.
</p>
</field>
</record>
<menuitem name="Mailings" id="mass_mailing_menu"
parent="mass_mailing_menu_root"
sequence="1"
action="mailing_mailing_action_mail"
groups="mass_mailing.group_mass_mailing_user"/>
</odoo>
|