Skip to content

Commit 5cd0121

Browse files
[MIG] event_stage_cancelled: Migration to 18.0
1 parent e01f118 commit 5cd0121

File tree

6 files changed

+92
-45
lines changed

6 files changed

+92
-45
lines changed

event_stage_cancelled/README.rst

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,13 @@ Event cancellation workflows
1717
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
1818
:alt: License: AGPL-3
1919
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fevent-lightgray.png?logo=github
20-
:target: https://github.com/OCA/event/tree/17.0/event_stage_cancelled
20+
:target: https://github.com/OCA/event/tree/18.0/event_stage_cancelled
2121
:alt: OCA/event
2222
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
23-
:target: https://translation.odoo-community.org/projects/event-17-0/event-17-0-event_stage_cancelled
23+
:target: https://translation.odoo-community.org/projects/event-18-0/event-18-0-event_stage_cancelled
2424
:alt: Translate me on Weblate
2525
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
26-
:target: https://runboat.odoo-community.org/builds?repo=OCA/event&target_branch=17.0
26+
:target: https://runboat.odoo-community.org/builds?repo=OCA/event&target_branch=18.0
2727
:alt: Try me on Runboat
2828

2929
|badge1| |badge2| |badge3| |badge4| |badge5|
@@ -86,7 +86,7 @@ Bug Tracker
8686
Bugs are tracked on `GitHub Issues <https://github.com/OCA/event/issues>`_.
8787
In case of trouble, please check there if your issue has already been reported.
8888
If you spotted it first, help us to smash it by providing a detailed and welcomed
89-
`feedback <https://github.com/OCA/event/issues/new?body=module:%20event_stage_cancelled%0Aversion:%2017.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
89+
`feedback <https://github.com/OCA/event/issues/new?body=module:%20event_stage_cancelled%0Aversion:%2018.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
9090

9191
Do not contact contributors directly about support or help with technical issues.
9292

@@ -105,6 +105,10 @@ Contributors
105105

106106
- David Vidal
107107

108+
- `Heliconia Solutions Pvt. Ltd. <https://www.heliconia.io>`__
109+
110+
- Bhavesh Heliconia
111+
108112
Maintainers
109113
-----------
110114

@@ -118,6 +122,6 @@ OCA, or the Odoo Community Association, is a nonprofit organization whose
118122
mission is to support the collaborative development of Odoo features and
119123
promote its widespread use.
120124

121-
This module is part of the `OCA/event <https://github.com/OCA/event/tree/17.0/event_stage_cancelled>`_ project on GitHub.
125+
This module is part of the `OCA/event <https://github.com/OCA/event/tree/18.0/event_stage_cancelled>`_ project on GitHub.
122126

123127
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

event_stage_cancelled/__manifest__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
33
{
44
"name": "Event cancellation workflows",
5-
"version": "17.0.1.0.0",
5+
"version": "18.0.1.0.0",
66
"category": "Marketing",
77
"author": "Tecnativa, Odoo Community Association (OCA)",
88
"website": "https://github.com/OCA/event",

event_stage_cancelled/data/mail_template_data.xml

Lines changed: 61 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,13 @@
66
<field name="subject">{{ object.event_id.name }}: event cancelled</field>
77
<field
88
name="email_from"
9-
>{{ (object.event_id.organizer_id.email_formatted or object.event_id.user_id.email_formatted or '') }}</field>
9+
>{{ (object.event_id.organizer_id.email_formatted or object.event_id.user_id.email_formatted or '') }}
10+
</field>
1011
<field
1112
name="email_to"
12-
>{{ (object.email and '"%s" &lt;%s&gt;' % (object.name, object.email) or object.partner_id.email_formatted or '') }}</field>
13+
>{{ (object.email and '"%s" &lt;%s&gt;' % (object.name, object.email) or object.partner_id.email_formatted or
14+
'') }}
15+
</field>
1316
<field name="body_html" type="html">
1417
<table
1518
border="0"
@@ -63,16 +66,17 @@
6366
<span
6467
style="font-size: 20px; font-weight: bold;"
6568
t-out="object.name or ''"
66-
>Oscar Morgan</span>
69+
>Oscar Morgan
70+
</span>
6771
</td>
6872
<td valign="middle" align="right">
6973
<t t-if="is_online">
7074
<a
7175
t-attf-href="{{ object.event_id.website_url }}"
7276
style="padding: 8px 12px; font-size: 12px; color: #FFFFFF; text-decoration: none !important; font-weight: 400; background-color: #875A7B; border: 0px solid #875A7B; border-radius:3px"
7377
>
74-
View Event
75-
</a>
78+
View Event
79+
</a>
7680
</t>
7781
<t t-else="">
7882
<img
@@ -113,67 +117,81 @@
113117
style="font-size: 14px;"
114118
>
115119
<div>
116-
Hello <t t-out="object.name or ''">Oscar Morgan</t>,<br />
117-
We are sorry to inform you that the
118-
<t t-if="is_online">
120+
Hello <t
121+
t-out="object.name or ''"
122+
>Oscar Morgan</t>,
123+
<br />
124+
We are sorry to inform you that the
125+
<t t-if="is_online">
119126
<a
120127
t-att-href="object.event_id.website_url"
121128
style="color:#875A7B;text-decoration:none;"
122129
t-out="object.event_id.name or ''"
123-
>OpenWood Collection Online Reveal</a>
130+
>OpenWood Collection Online Reveal
131+
</a>
124132
</t>
125-
<t t-else="">
133+
<t t-else="">
126134
<strong
127135
t-out="object.event_id.name or ''"
128-
>OpenWood Collection Online Reveal</strong>
136+
>OpenWood Collection Online Reveal
137+
</strong>
129138
</t>
130-
has been cancelled.
131-
</div>
139+
has been cancelled.
140+
</div>
132141
<t t-if="event_organizer">
133142
<div>
134143
<br />
135144
<div
136-
>Please do not hesitate to contact the organizer at for further information:</div>
145+
>Please do not hesitate to contact the organizer at for
146+
further information:
147+
</div>
137148
<ul>
138149
<li
139150
t-out="event_organizer.name or ''"
140151
>YourCompany</li>
141152
<t
142153
t-if="event_organizer.email"
143154
>
144-
<li>Mail: <a
155+
<li>Mail:
156+
<a
145157
t-attf-href="mailto:{{ event_organizer.email }}"
146158
style="text-decoration:none;color:#875A7B;"
147159
t-out="event_organizer.email or ''"
148-
/></li>
160+
/>
161+
</li>
149162
</t>
150163
<t
151164
t-if="event_organizer.phone"
152165
>
153-
<li>Phone: <t
166+
<li>Phone:
167+
<t
154168
t-out="event_organizer.phone or ''"
155-
/></li>
169+
/>
170+
</li>
156171
</t>
157172
</ul>
158173
</div>
159174
</t>
160175
<div>
161-
We understand the inconvenience this may cause and sincerely apologize for any disappointment.<br
162-
/>
163-
<span style="color: #454748;">
164-
-- <br />
165-
<t t-if="event_organizer">
176+
We understand the inconvenience this may cause and sincerely
177+
apologize for any disappointment.
178+
<br />
179+
<span style="color: #454748;">
180+
--
181+
<br />
182+
<t t-if="event_organizer">
166183
<t
167184
t-out="event_organizer.name or ''"
168185
>YourCompany</t>
169186
</t>
170-
<t t-else="">
171-
The <t
187+
<t t-else="">
188+
The <t
172189
t-out="object.event_id.name or ''"
173-
>OpenWood Collection Online Reveal</t> Team
174-
</t>
175-
</span>
176-
</div>
190+
>OpenWood Collection Online Reveal
191+
</t> Team
192+
</t>
193+
</span>
194+
</div>
177195
</td>
178196
</tr>
179197
</table>
@@ -196,17 +214,24 @@
196214
>
197215
<tr>
198216
<td style="text-align: center; font-size: 14px;">
199-
Sent by <a
217+
Sent by
218+
<a
200219
target="_blank"
201220
t-attf-href="{{ object.company_id.website }}"
202221
style="color: #875A7B;"
203222
t-out="object.company_id.name or ''"
204-
>YourCompany</a>
205-
<t t-if="'website_url' in object.event_id and object.event_id.website_url">
206-
<br />
207-
Discover <a href="/event" style="color:#875A7B;">all our events</a>.
208-
</t>
209-
</td>
223+
>YourCompany
224+
</a>
225+
<t
226+
t-if="'website_url' in object.event_id and object.event_id.website_url"
227+
>
228+
<br />
229+
Discover <a
230+
href="/event"
231+
style="color:#875A7B;"
232+
>all our events</a>.
233+
</t>
234+
</td>
210235
</tr>
211236
</table>
212237
</td>

event_stage_cancelled/models/event_mail.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,18 @@ def _compute_scheduled_date(self):
3131
)
3232
return res
3333

34+
@api.depends("interval_type", "mail_done", "scheduled_date")
35+
def _compute_mail_state(self):
36+
todo = self.filtered(lambda x: x.interval_type == "after_cancel")
37+
for scheduler in todo:
38+
if scheduler.mail_done:
39+
scheduler.mail_state = "sent"
40+
elif scheduler.scheduled_date:
41+
scheduler.mail_state = "scheduled"
42+
else:
43+
scheduler.mail_state = "running"
44+
return super(EventMail, self - todo)._compute_mail_state()
45+
3446
def execute(self):
3547
"""Plan the mailings"""
3648
regular_schedulers = self.filtered(lambda x: x.interval_type != "after_cancel")
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
- [Tecnativa](https://tecnativa.com)
22
- David Vidal
3+
- [Heliconia Solutions Pvt. Ltd.](https://www.heliconia.io)
4+
- Bhavesh Heliconia

event_stage_cancelled/static/description/index.html

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,7 @@ <h1 class="title">Event cancellation workflows</h1>
369369
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
370370
!! source digest: sha256:215ccf9ff3805b28dd2784676cd51483becf64b645161e4d37fbcd93f2cfbccf
371371
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
372-
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/event/tree/17.0/event_stage_cancelled"><img alt="OCA/event" src="https://img.shields.io/badge/github-OCA%2Fevent-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/event-17-0/event-17-0-event_stage_cancelled"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/event&amp;target_branch=17.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
372+
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/event/tree/18.0/event_stage_cancelled"><img alt="OCA/event" src="https://img.shields.io/badge/github-OCA%2Fevent-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/event-18-0/event-18-0-event_stage_cancelled"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/event&amp;target_branch=18.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
373373
<p>This module adds the posibility of flagging an event stage as cancelled
374374
so we can hook workflows onto it like cancelling registrations or
375375
scheduling special mail events.</p>
@@ -434,7 +434,7 @@ <h1><a class="toc-backref" href="#toc-entry-5">Bug Tracker</a></h1>
434434
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/event/issues">GitHub Issues</a>.
435435
In case of trouble, please check there if your issue has already been reported.
436436
If you spotted it first, help us to smash it by providing a detailed and welcomed
437-
<a class="reference external" href="https://github.com/OCA/event/issues/new?body=module:%20event_stage_cancelled%0Aversion:%2017.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
437+
<a class="reference external" href="https://github.com/OCA/event/issues/new?body=module:%20event_stage_cancelled%0Aversion:%2018.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
438438
<p>Do not contact contributors directly about support or help with technical issues.</p>
439439
</div>
440440
<div class="section" id="credits">
@@ -452,6 +452,10 @@ <h2><a class="toc-backref" href="#toc-entry-8">Contributors</a></h2>
452452
<li>David Vidal</li>
453453
</ul>
454454
</li>
455+
<li><a class="reference external" href="https://www.heliconia.io">Heliconia Solutions Pvt. Ltd.</a><ul>
456+
<li>Bhavesh Heliconia</li>
457+
</ul>
458+
</li>
455459
</ul>
456460
</div>
457461
<div class="section" id="maintainers">
@@ -463,7 +467,7 @@ <h2><a class="toc-backref" href="#toc-entry-9">Maintainers</a></h2>
463467
<p>OCA, or the Odoo Community Association, is a nonprofit organization whose
464468
mission is to support the collaborative development of Odoo features and
465469
promote its widespread use.</p>
466-
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/event/tree/17.0/event_stage_cancelled">OCA/event</a> project on GitHub.</p>
470+
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/event/tree/18.0/event_stage_cancelled">OCA/event</a> project on GitHub.</p>
467471
<p>You are welcome to contribute. To learn how please visit <a class="reference external" href="https://odoo-community.org/page/Contribute">https://odoo-community.org/page/Contribute</a>.</p>
468472
</div>
469473
</div>

0 commit comments

Comments
 (0)