From ecff97b27322de78310ae9d4f03bca5d445e5acf Mon Sep 17 00:00:00 2001
From: David
Date: Fri, 9 Feb 2024 16:59:07 +0100
Subject: [PATCH 1/9] [ADD] event_stage_cancelled: New module
TT47686
---
event_stage_cancelled/README.rst | 112 +++++
event_stage_cancelled/__init__.py | 1 +
event_stage_cancelled/__manifest__.py | 16 +
event_stage_cancelled/data/event_data.xml | 6 +
event_stage_cancelled/models/__init__.py | 2 +
event_stage_cancelled/models/event_event.py | 31 ++
event_stage_cancelled/models/event_stage.py | 9 +
event_stage_cancelled/readme/CONFIGURE.md | 4 +
event_stage_cancelled/readme/CONTEXT.md | 3 +
event_stage_cancelled/readme/CONTRIBUTORS.md | 2 +
event_stage_cancelled/readme/DESCRIPTION.md | 2 +
event_stage_cancelled/readme/ROADMAP.md | 3 +
event_stage_cancelled/readme/USAGE.md | 5 +
.../static/description/index.html | 460 ++++++++++++++++++
.../views/event_event_views.xml | 19 +
.../views/event_stage_views.xml | 12 +
16 files changed, 687 insertions(+)
create mode 100644 event_stage_cancelled/README.rst
create mode 100644 event_stage_cancelled/__init__.py
create mode 100644 event_stage_cancelled/__manifest__.py
create mode 100644 event_stage_cancelled/data/event_data.xml
create mode 100644 event_stage_cancelled/models/__init__.py
create mode 100644 event_stage_cancelled/models/event_event.py
create mode 100644 event_stage_cancelled/models/event_stage.py
create mode 100644 event_stage_cancelled/readme/CONFIGURE.md
create mode 100644 event_stage_cancelled/readme/CONTEXT.md
create mode 100644 event_stage_cancelled/readme/CONTRIBUTORS.md
create mode 100644 event_stage_cancelled/readme/DESCRIPTION.md
create mode 100644 event_stage_cancelled/readme/ROADMAP.md
create mode 100644 event_stage_cancelled/readme/USAGE.md
create mode 100644 event_stage_cancelled/static/description/index.html
create mode 100644 event_stage_cancelled/views/event_event_views.xml
create mode 100644 event_stage_cancelled/views/event_stage_views.xml
diff --git a/event_stage_cancelled/README.rst b/event_stage_cancelled/README.rst
new file mode 100644
index 000000000..6cbd432fa
--- /dev/null
+++ b/event_stage_cancelled/README.rst
@@ -0,0 +1,112 @@
+============================
+Event cancellation workflows
+============================
+
+..
+ !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+ !! This file is generated by oca-gen-addon-readme !!
+ !! changes will be overwritten. !!
+ !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+ !! source digest: sha256:4883ca883b1049ca7e9f62f7aff2150e549d2186a7a2d6a942cd580fd82ef194
+ !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+
+.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
+ :target: https://odoo-community.org/page/development-status
+ :alt: Beta
+.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
+ :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
+ :alt: License: AGPL-3
+.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fevent-lightgray.png?logo=github
+ :target: https://github.com/OCA/event/tree/15.0/event_stage_cancelled
+ :alt: OCA/event
+.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
+ :target: https://translation.odoo-community.org/projects/event-15-0/event-15-0-event_stage_cancelled
+ :alt: Translate me on Weblate
+.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
+ :target: https://runboat.odoo-community.org/builds?repo=OCA/event&target_branch=15.0
+ :alt: Try me on Runboat
+
+|badge1| |badge2| |badge3| |badge4| |badge5|
+
+This module adds the posibility of flaggin an event stage as cancelled
+so we can hook workflows onto it.
+
+**Table of contents**
+
+.. contents::
+ :local:
+
+Use Cases / Context
+===================
+
+Up to v14, events had an state field instead of configurable stages. A
+lost feature with that change was the concept of a cancelled event and
+with it the logic associated to it: when we cancelled an event, its
+registrations were cancelled along with it.
+
+Configuration
+=============
+
+To set a stage as cancelled:
+
+- Go to *Events > Configuration > Event Stages* and choose the one you
+ want to be the cancelled one.
+
+Usage
+=====
+
+When you want to cancel an event an its registration, just click on the
+*Cancel Event* button from the event itself.
+
+A confirmation dialog will show up and if you confirm it, the linked
+registrations will be cancelled as well.
+
+Known issues / Roadmap
+======================
+
+- If you just change the stage to the cancelled one, the registrations
+ won't be cancelled. This is avoided for the moment on purpose as a
+ confirmation dialog would require an special ``ir.actions.client``
+ implementation.
+
+Bug Tracker
+===========
+
+Bugs are tracked on `GitHub Issues `_.
+In case of trouble, please check there if your issue has already been reported.
+If you spotted it first, help us to smash it by providing a detailed and welcomed
+`feedback `_.
+
+Do not contact contributors directly about support or help with technical issues.
+
+Credits
+=======
+
+Authors
+-------
+
+* Tecnativa
+
+Contributors
+------------
+
+- `Tecnativa `__
+
+ - David Vidal
+
+Maintainers
+-----------
+
+This module is maintained by the OCA.
+
+.. image:: https://odoo-community.org/logo.png
+ :alt: Odoo Community Association
+ :target: https://odoo-community.org
+
+OCA, or the Odoo Community Association, is a nonprofit organization whose
+mission is to support the collaborative development of Odoo features and
+promote its widespread use.
+
+This module is part of the `OCA/event `_ project on GitHub.
+
+You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
diff --git a/event_stage_cancelled/__init__.py b/event_stage_cancelled/__init__.py
new file mode 100644
index 000000000..0650744f6
--- /dev/null
+++ b/event_stage_cancelled/__init__.py
@@ -0,0 +1 @@
+from . import models
diff --git a/event_stage_cancelled/__manifest__.py b/event_stage_cancelled/__manifest__.py
new file mode 100644
index 000000000..0aea4bbc0
--- /dev/null
+++ b/event_stage_cancelled/__manifest__.py
@@ -0,0 +1,16 @@
+# Copyright 2024 Tecnativa - David Vidal
+# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
+{
+ "name": "Event cancellation workflows",
+ "version": "15.0.1.0.0",
+ "category": "Marketing",
+ "author": "Tecnativa, Odoo Community Association (OCA)",
+ "website": "https://github.com/OCA/event",
+ "license": "AGPL-3",
+ "depends": ["event"],
+ "data": [
+ "data/event_data.xml",
+ "views/event_stage_views.xml",
+ "views/event_event_views.xml",
+ ],
+}
diff --git a/event_stage_cancelled/data/event_data.xml b/event_stage_cancelled/data/event_data.xml
new file mode 100644
index 000000000..f37a3276d
--- /dev/null
+++ b/event_stage_cancelled/data/event_data.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
diff --git a/event_stage_cancelled/models/__init__.py b/event_stage_cancelled/models/__init__.py
new file mode 100644
index 000000000..3facb3ef2
--- /dev/null
+++ b/event_stage_cancelled/models/__init__.py
@@ -0,0 +1,2 @@
+from . import event_event
+from . import event_stage
diff --git a/event_stage_cancelled/models/event_event.py b/event_stage_cancelled/models/event_event.py
new file mode 100644
index 000000000..c6b4cd1bf
--- /dev/null
+++ b/event_stage_cancelled/models/event_event.py
@@ -0,0 +1,31 @@
+# Copyright 2024 Tecnativa S.L. - David Vidal
+# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
+from odoo import api, fields, models
+
+
+class EventEvent(models.Model):
+ _inherit = "event.event"
+
+ show_cancel_button = fields.Boolean(compute="_compute_show_cancel_button")
+
+ @api.depends("stage_id")
+ def _compute_show_cancel_button(self):
+ """Don't show if there aren't cancel stages or if the event is done"""
+ stage_id = self.env["event.stage"].search(
+ [("is_cancelled", "=", True)], limit=1
+ )
+ for event in self:
+ event.show_cancel_button = (
+ not event.stage_id.is_cancelled
+ and not event.stage_id.pipe_end
+ and bool(stage_id)
+ )
+
+ def button_cancel(self):
+ """Perform cancellation of the attendees"""
+ stage_id = self.env["event.stage"].search(
+ [("is_cancelled", "=", True)], limit=1
+ )
+ if stage_id:
+ self.stage_id = stage_id
+ self.registration_ids.action_cancel()
diff --git a/event_stage_cancelled/models/event_stage.py b/event_stage_cancelled/models/event_stage.py
new file mode 100644
index 000000000..62ebe255a
--- /dev/null
+++ b/event_stage_cancelled/models/event_stage.py
@@ -0,0 +1,9 @@
+# Copyright 2024 Tecnativa S.L. - David Vidal
+# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
+from odoo import fields, models
+
+
+class EventStage(models.Model):
+ _inherit = "event.stage"
+
+ is_cancelled = fields.Boolean(help="The event is cancelled")
diff --git a/event_stage_cancelled/readme/CONFIGURE.md b/event_stage_cancelled/readme/CONFIGURE.md
new file mode 100644
index 000000000..8489b4c1b
--- /dev/null
+++ b/event_stage_cancelled/readme/CONFIGURE.md
@@ -0,0 +1,4 @@
+To set a stage as cancelled:
+
+- Go to *Events > Configuration > Event Stages* and choose the one you want to be
+ the cancelled one.
diff --git a/event_stage_cancelled/readme/CONTEXT.md b/event_stage_cancelled/readme/CONTEXT.md
new file mode 100644
index 000000000..a8d7ecdd1
--- /dev/null
+++ b/event_stage_cancelled/readme/CONTEXT.md
@@ -0,0 +1,3 @@
+Up to v14, events had an state field instead of configurable stages. A lost feature
+with that change was the concept of a cancelled event and with it the logic associated
+to it: when we cancelled an event, its registrations were cancelled along with it.
diff --git a/event_stage_cancelled/readme/CONTRIBUTORS.md b/event_stage_cancelled/readme/CONTRIBUTORS.md
new file mode 100644
index 000000000..3a16ddf04
--- /dev/null
+++ b/event_stage_cancelled/readme/CONTRIBUTORS.md
@@ -0,0 +1,2 @@
+- [Tecnativa](https://tecnativa.com)
+ - David Vidal
diff --git a/event_stage_cancelled/readme/DESCRIPTION.md b/event_stage_cancelled/readme/DESCRIPTION.md
new file mode 100644
index 000000000..654f5c136
--- /dev/null
+++ b/event_stage_cancelled/readme/DESCRIPTION.md
@@ -0,0 +1,2 @@
+This module adds the posibility of flaggin an event stage as cancelled so we can hook
+workflows onto it.
diff --git a/event_stage_cancelled/readme/ROADMAP.md b/event_stage_cancelled/readme/ROADMAP.md
new file mode 100644
index 000000000..aae4bf73d
--- /dev/null
+++ b/event_stage_cancelled/readme/ROADMAP.md
@@ -0,0 +1,3 @@
+- If you just change the stage to the cancelled one, the registrations won't be
+ cancelled. This is avoided for the moment on purpose as a confirmation dialog would
+ require an special `ir.actions.client` implementation.
diff --git a/event_stage_cancelled/readme/USAGE.md b/event_stage_cancelled/readme/USAGE.md
new file mode 100644
index 000000000..16e3f3f0c
--- /dev/null
+++ b/event_stage_cancelled/readme/USAGE.md
@@ -0,0 +1,5 @@
+When you want to cancel an event an its registration, just click on the *Cancel Event*
+button from the event itself.
+
+A confirmation dialog will show up and if you confirm it, the linked registrations will
+be cancelled as well.
diff --git a/event_stage_cancelled/static/description/index.html b/event_stage_cancelled/static/description/index.html
new file mode 100644
index 000000000..768b81433
--- /dev/null
+++ b/event_stage_cancelled/static/description/index.html
@@ -0,0 +1,460 @@
+
+
+
+
+
+
+Event cancellation workflows
+
+
+
+
+
Event cancellation workflows
+
+
+

+
This module adds the posibility of flaggin an event stage as cancelled
+so we can hook workflows onto it.
+
Table of contents
+
+
+
+
Up to v14, events had an state field instead of configurable stages. A
+lost feature with that change was the concept of a cancelled event and
+with it the logic associated to it: when we cancelled an event, its
+registrations were cancelled along with it.
+
+
+
+
To set a stage as cancelled:
+
+- Go to Events > Configuration > Event Stages and choose the one you
+want to be the cancelled one.
+
+
+
+
+
When you want to cancel an event an its registration, just click on the
+Cancel Event button from the event itself.
+
A confirmation dialog will show up and if you confirm it, the linked
+registrations will be cancelled as well.
+
+
+
+
+- If you just change the stage to the cancelled one, the registrations
+won’t be cancelled. This is avoided for the moment on purpose as a
+confirmation dialog would require an special ir.actions.client
+implementation.
+
+
+
+
+
Bugs are tracked on GitHub Issues.
+In case of trouble, please check there if your issue has already been reported.
+If you spotted it first, help us to smash it by providing a detailed and welcomed
+feedback.
+
Do not contact contributors directly about support or help with technical issues.
+
+
+
+
+
+
+
+
This module is maintained by the OCA.
+

+
OCA, or the Odoo Community Association, is a nonprofit organization whose
+mission is to support the collaborative development of Odoo features and
+promote its widespread use.
+
This module is part of the OCA/event project on GitHub.
+
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
+
+
+
+
+
diff --git a/event_stage_cancelled/views/event_event_views.xml b/event_stage_cancelled/views/event_event_views.xml
new file mode 100644
index 000000000..23350958a
--- /dev/null
+++ b/event_stage_cancelled/views/event_event_views.xml
@@ -0,0 +1,19 @@
+
+
+
+ event.event
+
+
+
+
+
+
diff --git a/event_stage_cancelled/views/event_stage_views.xml b/event_stage_cancelled/views/event_stage_views.xml
new file mode 100644
index 000000000..8a4f9d846
--- /dev/null
+++ b/event_stage_cancelled/views/event_stage_views.xml
@@ -0,0 +1,12 @@
+
+
+
+ event.stage
+
+
+
+
+
+
+
+
From ffdcb53e8ce29c56ceb92404d7f68cc6a72bfeb6 Mon Sep 17 00:00:00 2001
From: David
Date: Thu, 15 Feb 2024 17:21:52 +0100
Subject: [PATCH 2/9] [IMP] event_stage_cancelled: after cancel mail schedule
[UPD] Update event_stage_cancelled.pot
[BOT] post-merge updates
---
event_stage_cancelled/README.rst | 17 +-
event_stage_cancelled/__manifest__.py | 1 +
.../data/mail_template_data.xml | 184 ++++++++
event_stage_cancelled/i18n/es.po | 392 ++++++++++++++++++
.../i18n/event_stage_cancelled.pot | 214 ++++++++++
event_stage_cancelled/models/__init__.py | 3 +
event_stage_cancelled/models/event_event.py | 6 +-
event_stage_cancelled/models/event_mail.py | 98 +++++
.../models/event_registration.py | 19 +
.../models/event_type_mail.py | 12 +
event_stage_cancelled/readme/CONFIGURE.md | 10 +
event_stage_cancelled/readme/DESCRIPTION.md | 4 +-
.../static/description/icon.png | Bin 0 -> 9455 bytes
.../static/description/index.html | 16 +-
event_stage_cancelled/tests/__init__.py | 1 +
.../tests/test_event_stage_cancelled.py | 86 ++++
16 files changed, 1054 insertions(+), 9 deletions(-)
create mode 100644 event_stage_cancelled/data/mail_template_data.xml
create mode 100644 event_stage_cancelled/i18n/es.po
create mode 100644 event_stage_cancelled/i18n/event_stage_cancelled.pot
create mode 100644 event_stage_cancelled/models/event_mail.py
create mode 100644 event_stage_cancelled/models/event_registration.py
create mode 100644 event_stage_cancelled/models/event_type_mail.py
create mode 100644 event_stage_cancelled/static/description/icon.png
create mode 100644 event_stage_cancelled/tests/__init__.py
create mode 100644 event_stage_cancelled/tests/test_event_stage_cancelled.py
diff --git a/event_stage_cancelled/README.rst b/event_stage_cancelled/README.rst
index 6cbd432fa..255dcc05c 100644
--- a/event_stage_cancelled/README.rst
+++ b/event_stage_cancelled/README.rst
@@ -7,7 +7,7 @@ Event cancellation workflows
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
- !! source digest: sha256:4883ca883b1049ca7e9f62f7aff2150e549d2186a7a2d6a942cd580fd82ef194
+ !! source digest: sha256:2c6facd843a69eb5970fe525b81d5e5364d69baa69bdb84e31580e41f5312782
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
@@ -28,8 +28,9 @@ Event cancellation workflows
|badge1| |badge2| |badge3| |badge4| |badge5|
-This module adds the posibility of flaggin an event stage as cancelled
-so we can hook workflows onto it.
+This module adds the posibility of flagging an event stage as cancelled
+so we can hook workflows onto it like cancelling registrations or
+scheduling special mail events.
**Table of contents**
@@ -52,6 +53,16 @@ To set a stage as cancelled:
- Go to *Events > Configuration > Event Stages* and choose the one you
want to be the cancelled one.
+To schedule a mail that triggers when the event is cancelled:
+
+- Go to *Events* and select an event.
+- Go to the *Communication* tab and add a new scheduler.
+- Choose to trigger it *After the event cancellation*.
+- Choose the other parameters like template or the interval.
+
+When the event is cancelled, the corresponding mail will be sent to the
+attendants who where confirmed at the moment of the cancellation.
+
Usage
=====
diff --git a/event_stage_cancelled/__manifest__.py b/event_stage_cancelled/__manifest__.py
index 0aea4bbc0..e23640456 100644
--- a/event_stage_cancelled/__manifest__.py
+++ b/event_stage_cancelled/__manifest__.py
@@ -10,6 +10,7 @@
"depends": ["event"],
"data": [
"data/event_data.xml",
+ "data/mail_template_data.xml",
"views/event_stage_views.xml",
"views/event_event_views.xml",
],
diff --git a/event_stage_cancelled/data/mail_template_data.xml b/event_stage_cancelled/data/mail_template_data.xml
new file mode 100644
index 000000000..bf9b2499a
--- /dev/null
+++ b/event_stage_cancelled/data/mail_template_data.xml
@@ -0,0 +1,184 @@
+
+
+
+ Event: Cancelled
+
+ {{ object.event_id.name }}: event cancelled
+ {{ (object.event_id.organizer_id.email_formatted or object.event_id.user_id.email_formatted or '') }}
+ {{ (object.email and '"%s" <%s>' % (object.name, object.email) or object.partner_id.email_formatted or '') }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Your registration
+ Oscar Morgan
+ |
+
+
+ View Event
+
+
+
+
+
+ |
+
+
+ |
+
+ |
+
+
+
+
+
+
+
+
+
+
+ Please do not hesitate to contact the organizer at for further information:
+
+ - YourCompany
+
+ - Mail:
+
+
+ - Phone:
+
+
+
+
+
+ We understand the inconvenience this may cause and sincerely apologize for any disappointment.
+
+ --
+
+ YourCompany
+
+
+ The OpenWood Collection Online Reveal Team
+
+
+
+ |
+
+ |
+
+
+
+ |
+
+|
+
+ |
+
+
+ {{ object.partner_id.lang }}
+
+
diff --git a/event_stage_cancelled/i18n/es.po b/event_stage_cancelled/i18n/es.po
new file mode 100644
index 000000000..2a32467dd
--- /dev/null
+++ b/event_stage_cancelled/i18n/es.po
@@ -0,0 +1,392 @@
+# Translation of Odoo Server.
+# This file contains the translation of the following modules:
+# * event_stage_cancelled
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: Odoo Server 15.0\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2024-02-19 09:15+0000\n"
+"PO-Revision-Date: 2024-02-19 10:29+0100\n"
+"Last-Translator: \n"
+"Language-Team: \n"
+"Language: es\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+"X-Generator: Poedit 3.4.2\n"
+
+#. module: event_stage_cancelled
+#: model:mail.template,body_html:event_stage_cancelled.event_cancelled
+msgid ""
+"\n"
+"\n"
+"\n"
+"\n"
+"\n"
+"\n"
+"\n"
+"\n"
+"\n"
+"\n"
+" \n"
+" \n"
+" \n"
+" Your registration"
+"span> \n"
+" Oscar Morgan\n"
+" | \n"
+" \n"
+" \n"
+" View Event\n"
+" \n"
+" \n"
+" \n"
+" \n"
+" \n"
+" | \n"
+" \n"
+" \n"
+" | \n"
+" \n"
+" | \n"
+" \n"
+"\n"
+"\n"
+" \n"
+" \n"
+" \n"
+" \n"
+" Hello Oscar Morgan,"
+" \n"
+" We are sorry to inform you that the\n"
+" \n"
+" OpenWood Collection Online Reveal\n"
+" \n"
+" \n"
+" OpenWood Collection Online Reveal\n"
+" \n"
+" has been cancelled.\n"
+" \n"
+" \n"
+" \n"
+" \n"
+" Please do not hesitate to contact the "
+"organizer at for further information: \n"
+" \n"
+" - YourCompany
\n"
+" \n"
+" - Mail:
\n"
+" \n"
+" \n"
+" - Phone:
\n"
+" \n"
+" \n"
+" \n"
+" \n"
+" \n"
+" We understand the inconvenience this may cause and "
+"sincerely apologize for any disappointment. \n"
+" \n"
+" -- \n"
+" \n"
+" YourCompany\n"
+" \n"
+" \n"
+" The OpenWood Collection Online Reveal Team\n"
+" \n"
+" \n"
+" \n"
+" | \n"
+" \n"
+" | \n"
+" \n"
+"\n"
+" \n"
+" |
\n"
+"\n"
+"| \n"
+"\n"
+" |
\n"
+"
\n"
+" "
+msgstr ""
+"\n"
+"\n"
+"\n"
+"\n"
+"\n"
+"\n"
+"\n"
+"\n"
+"\n"
+"\n"
+" \n"
+" \n"
+" \n"
+" Su registro \n"
+" Oscar Morgan\n"
+" | \n"
+" \n"
+" \n"
+" Ver evento\n"
+" \n"
+" \n"
+" \n"
+" \n"
+" \n"
+" | \n"
+" \n"
+" \n"
+" | \n"
+" \n"
+" | \n"
+" \n"
+"\n"
+"\n"
+" \n"
+" \n"
+" \n"
+" \n"
+" Hola, Oscar Morgan."
+" \n"
+" Lamentamos informarle de que el evento \n"
+" \n"
+" OpenWood Collection Online Reveal\n"
+" \n"
+" \n"
+" OpenWood Collection Online Reveal\n"
+" \n"
+" ha sido cancelado.\n"
+" \n"
+" \n"
+" \n"
+" \n"
+" Por favor, no dude en ponerse en contacto con "
+"el organizador para más información: \n"
+" \n"
+" - Tu "
+"compañía
\n"
+" \n"
+" - Correo:
\n"
+" \n"
+" \n"
+" - Teléfono:
\n"
+" \n"
+" \n"
+" \n"
+" \n"
+" \n"
+" Entendemos los inconvenientes que esto pueda causar y "
+"pedimos sinceras disculpas por cualquier molestia ocasionada. \n"
+" \n"
+" -- \n"
+" \n"
+" Tu "
+"compañía\n"
+" \n"
+" \n"
+" El equipo de OpenWood Collection Online Reveal\n"
+" \n"
+" \n"
+" \n"
+" | \n"
+" \n"
+" | \n"
+" \n"
+"\n"
+" \n"
+" |
\n"
+"\n"
+"| \n"
+"\n"
+" |
\n"
+"
\n"
+" "
+
+#. module: event_stage_cancelled
+#: model:ir.model.fields.selection,name:event_stage_cancelled.selection__event_mail__interval_type__after_cancel
+#: model:ir.model.fields.selection,name:event_stage_cancelled.selection__event_type_mail__interval_type__after_cancel
+msgid "After the event cancellation"
+msgstr "Tras la cancelación del evento"
+
+#. module: event_stage_cancelled
+#: model_terms:ir.ui.view,arch_db:event_stage_cancelled.view_event_form
+msgid ""
+"Are you sure you want to cancel this event? All the linked attendees will "
+"be cancelled as well."
+msgstr ""
+"¿Está seguro que quiere cancelar este evento? Todos los asistentes "
+"vinculados serán cancelados también."
+
+#. module: event_stage_cancelled
+#: model_terms:ir.ui.view,arch_db:event_stage_cancelled.view_event_form
+msgid "Cancel Event"
+msgstr "Cancelar evento"
+
+#. module: event_stage_cancelled
+#: model:ir.model.fields,field_description:event_stage_cancelled.field_event_registration__cancelled_from_event
+msgid "Cancelled From Event"
+msgstr "Cancelado desde el evento"
+
+#. module: event_stage_cancelled
+#: model:ir.model,name:event_stage_cancelled.model_event_event
+msgid "Event"
+msgstr "Evento"
+
+#. module: event_stage_cancelled
+#: model:ir.model,name:event_stage_cancelled.model_event_mail
+msgid "Event Automated Mailing"
+msgstr "Envío automático de correos de eventos"
+
+#. module: event_stage_cancelled
+#: model:ir.model,name:event_stage_cancelled.model_event_registration
+msgid "Event Registration"
+msgstr "Registro a evento"
+
+#. module: event_stage_cancelled
+#: model:ir.model,name:event_stage_cancelled.model_event_stage
+msgid "Event Stage"
+msgstr "Etapa del evento"
+
+#. module: event_stage_cancelled
+#: model:mail.template,name:event_stage_cancelled.event_cancelled
+msgid "Event: Cancelled"
+msgstr "Evento: Cancelado"
+
+#. module: event_stage_cancelled
+#: model:ir.model.fields,field_description:event_stage_cancelled.field_event_stage__is_cancelled
+msgid "Is Cancelled"
+msgstr "Está cancelado"
+
+#. module: event_stage_cancelled
+#: model:ir.model,name:event_stage_cancelled.model_event_type_mail
+msgid "Mail Scheduling on Event Category"
+msgstr "Programación de correo en la categoría de eventos"
+
+#. module: event_stage_cancelled
+#: model:ir.model,name:event_stage_cancelled.model_event_mail_registration
+msgid "Registration Mail Scheduler"
+msgstr "Programador de correos de inscripciones"
+
+#. module: event_stage_cancelled
+#: model:ir.model.fields,field_description:event_stage_cancelled.field_event_event__show_cancel_button
+msgid "Show Cancel Button"
+msgstr "Mostrar el botón de cancelación"
+
+#. module: event_stage_cancelled
+#: model:ir.model.fields,help:event_stage_cancelled.field_event_registration__cancelled_from_event
+msgid ""
+"Technical field to distinguish those registrations which where cancelled "
+"from the event so we can, for example send them scheduled mails after the "
+"cancellation but not if the were cancelled before that"
+msgstr ""
+"Campo técnico para distinguir aquellos asistentes que fueron cancelados "
+"desde el evento de modo que podamos, por ejemplo, enviarles notificaciones "
+"programadas tras dicha cancelación pero no a aquellos asistentes que "
+"hubiesen sido cancelados antes."
+
+#. module: event_stage_cancelled
+#: model:ir.model.fields,help:event_stage_cancelled.field_event_stage__is_cancelled
+msgid "The event is cancelled"
+msgstr "El evento está cancelado"
+
+#. module: event_stage_cancelled
+#: model:ir.model.fields,field_description:event_stage_cancelled.field_event_type_mail__interval_type
+msgid "Trigger"
+msgstr "Activador"
+
+#. module: event_stage_cancelled
+#: model:ir.model.fields,field_description:event_stage_cancelled.field_event_mail__interval_type
+msgid "Trigger "
+msgstr "Desencadenar "
+
+#. module: event_stage_cancelled
+#: model:mail.template,subject:event_stage_cancelled.event_cancelled
+msgid "{{ object.event_id.name }}: event cancelled"
+msgstr "{{ object.event_id.name }}: evento cancelado"
diff --git a/event_stage_cancelled/i18n/event_stage_cancelled.pot b/event_stage_cancelled/i18n/event_stage_cancelled.pot
new file mode 100644
index 000000000..5d0820a6f
--- /dev/null
+++ b/event_stage_cancelled/i18n/event_stage_cancelled.pot
@@ -0,0 +1,214 @@
+# Translation of Odoo Server.
+# This file contains the translation of the following modules:
+# * event_stage_cancelled
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: Odoo Server 15.0\n"
+"Report-Msgid-Bugs-To: \n"
+"Last-Translator: \n"
+"Language-Team: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: \n"
+"Plural-Forms: \n"
+
+#. module: event_stage_cancelled
+#: model:mail.template,body_html:event_stage_cancelled.event_cancelled
+msgid ""
+"\n"
+"\n"
+"\n"
+"\n"
+"\n"
+"\n"
+"\n"
+"\n"
+"\n"
+"\n"
+" \n"
+" \n"
+" \n"
+" Your registration \n"
+" Oscar Morgan\n"
+" | \n"
+" \n"
+" \n"
+" View Event\n"
+" \n"
+" \n"
+" \n"
+" \n"
+" \n"
+" | \n"
+" \n"
+" \n"
+" | \n"
+" \n"
+" | \n"
+" \n"
+"\n"
+"\n"
+" \n"
+" \n"
+" \n"
+" \n"
+" Hello Oscar Morgan, \n"
+" We are sorry to inform you that the\n"
+" \n"
+" OpenWood Collection Online Reveal\n"
+" \n"
+" \n"
+" OpenWood Collection Online Reveal\n"
+" \n"
+" has been cancelled.\n"
+" \n"
+" \n"
+" \n"
+" \n"
+" Please do not hesitate to contact the organizer at for further information: \n"
+" \n"
+" - YourCompany
\n"
+" \n"
+" - Mail:
\n"
+" \n"
+" \n"
+" - Phone:
\n"
+" \n"
+" \n"
+" \n"
+" \n"
+" \n"
+" We understand the inconvenience this may cause and sincerely apologize for any disappointment. \n"
+" \n"
+" -- \n"
+" \n"
+" YourCompany\n"
+" \n"
+" \n"
+" The OpenWood Collection Online Reveal Team\n"
+" \n"
+" \n"
+" \n"
+" | \n"
+" \n"
+" | \n"
+" \n"
+"\n"
+" \n"
+" |
\n"
+"\n"
+"| \n"
+"\n"
+" |
\n"
+"
\n"
+" "
+msgstr ""
+
+#. module: event_stage_cancelled
+#: model:ir.model.fields.selection,name:event_stage_cancelled.selection__event_mail__interval_type__after_cancel
+#: model:ir.model.fields.selection,name:event_stage_cancelled.selection__event_mail_scheduler_template__interval_type__after_cancel
+#: model:ir.model.fields.selection,name:event_stage_cancelled.selection__event_type_mail__interval_type__after_cancel
+msgid "After the event cancellation"
+msgstr ""
+
+#. module: event_stage_cancelled
+#: model_terms:ir.ui.view,arch_db:event_stage_cancelled.view_event_form
+msgid ""
+"Are you sure you want to cancel this event? All the linked attendees will be"
+" cancelled as well."
+msgstr ""
+
+#. module: event_stage_cancelled
+#: model_terms:ir.ui.view,arch_db:event_stage_cancelled.view_event_form
+msgid "Cancel Event"
+msgstr ""
+
+#. module: event_stage_cancelled
+#: model:ir.model.fields,field_description:event_stage_cancelled.field_event_registration__cancelled_from_event
+msgid "Cancelled From Event"
+msgstr ""
+
+#. module: event_stage_cancelled
+#: model:ir.model,name:event_stage_cancelled.model_event_event
+msgid "Event"
+msgstr ""
+
+#. module: event_stage_cancelled
+#: model:ir.model,name:event_stage_cancelled.model_event_mail
+msgid "Event Automated Mailing"
+msgstr ""
+
+#. module: event_stage_cancelled
+#: model:ir.model,name:event_stage_cancelled.model_event_registration
+msgid "Event Registration"
+msgstr ""
+
+#. module: event_stage_cancelled
+#: model:ir.model,name:event_stage_cancelled.model_event_stage
+msgid "Event Stage"
+msgstr ""
+
+#. module: event_stage_cancelled
+#: model:mail.template,name:event_stage_cancelled.event_cancelled
+msgid "Event: Cancelled"
+msgstr ""
+
+#. module: event_stage_cancelled
+#: model:ir.model.fields,field_description:event_stage_cancelled.field_event_stage__is_cancelled
+msgid "Is Cancelled"
+msgstr ""
+
+#. module: event_stage_cancelled
+#: model:ir.model,name:event_stage_cancelled.model_event_type_mail
+msgid "Mail Scheduling on Event Category"
+msgstr ""
+
+#. module: event_stage_cancelled
+#: model:ir.model,name:event_stage_cancelled.model_event_mail_registration
+msgid "Registration Mail Scheduler"
+msgstr ""
+
+#. module: event_stage_cancelled
+#: model:ir.model.fields,field_description:event_stage_cancelled.field_event_event__show_cancel_button
+#: model:ir.model.fields,field_description:event_stage_cancelled.field_event_session__show_cancel_button
+msgid "Show Cancel Button"
+msgstr ""
+
+#. module: event_stage_cancelled
+#: model:ir.model.fields,help:event_stage_cancelled.field_event_registration__cancelled_from_event
+msgid ""
+"Technical field to distinguish those registrations which where cancelled "
+"from the event so we can, for example send them scheduled mails after the "
+"cancellation but not if the were cancelled before that"
+msgstr ""
+
+#. module: event_stage_cancelled
+#: model:ir.model.fields,help:event_stage_cancelled.field_event_stage__is_cancelled
+msgid "The event is cancelled"
+msgstr ""
+
+#. module: event_stage_cancelled
+#: model:ir.model.fields,field_description:event_stage_cancelled.field_event_type_mail__interval_type
+msgid "Trigger"
+msgstr ""
+
+#. module: event_stage_cancelled
+#: model:ir.model.fields,field_description:event_stage_cancelled.field_event_mail__interval_type
+#: model:ir.model.fields,field_description:event_stage_cancelled.field_event_mail_scheduler_template__interval_type
+#: model:ir.model.fields,field_description:event_stage_cancelled.field_event_mail_session__interval_type
+msgid "Trigger "
+msgstr ""
+
+#. module: event_stage_cancelled
+#: model:mail.template,subject:event_stage_cancelled.event_cancelled
+msgid "{{ object.event_id.name }}: event cancelled"
+msgstr ""
diff --git a/event_stage_cancelled/models/__init__.py b/event_stage_cancelled/models/__init__.py
index 3facb3ef2..309cea09e 100644
--- a/event_stage_cancelled/models/__init__.py
+++ b/event_stage_cancelled/models/__init__.py
@@ -1,2 +1,5 @@
from . import event_event
+from . import event_mail
+from . import event_registration
from . import event_stage
+from . import event_type_mail
diff --git a/event_stage_cancelled/models/event_event.py b/event_stage_cancelled/models/event_event.py
index c6b4cd1bf..c6e3e3833 100644
--- a/event_stage_cancelled/models/event_event.py
+++ b/event_stage_cancelled/models/event_event.py
@@ -28,4 +28,8 @@ def button_cancel(self):
)
if stage_id:
self.stage_id = stage_id
- self.registration_ids.action_cancel()
+ self.registration_ids.filtered(lambda x: x.state != "cancel").with_context(
+ cancelled_from_event=True,
+ # Compatibility with event_registration_cancel_reason
+ bypass_reason=True,
+ ).action_cancel()
diff --git a/event_stage_cancelled/models/event_mail.py b/event_stage_cancelled/models/event_mail.py
new file mode 100644
index 000000000..f9d1ca910
--- /dev/null
+++ b/event_stage_cancelled/models/event_mail.py
@@ -0,0 +1,98 @@
+# Copyright 2024 Tecnativa S.L. - David Vidal
+# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
+from odoo import api, fields, models
+
+from odoo.addons.event.models.event_mail import _INTERVALS
+
+
+class EventMail(models.Model):
+ _inherit = "event.mail"
+
+ interval_type = fields.Selection(
+ selection_add=[("after_cancel", "After the event cancellation")],
+ ondelete={"after_cancel": "cascade"},
+ )
+
+ @api.depends("event_id.stage_id")
+ def _compute_scheduled_date(self):
+ """When we cancel the event, we set the scheduled mail"""
+ regular_schedulers = self.filtered(lambda x: x.interval_type != "after_cancel")
+ res = super(EventMail, regular_schedulers)._compute_scheduled_date()
+ for scheduler in self.filtered(
+ lambda x: x.interval_type == "after_cancel"
+ and x.event_id.stage_id.is_cancelled
+ ):
+ date, sign = scheduler.event_id.write_date, 1
+ scheduler.scheduled_date = (
+ date
+ + _INTERVALS[scheduler.interval_unit](sign * scheduler.interval_nbr)
+ if date
+ else False
+ )
+ return res
+
+ def execute(self):
+ """Plan the mailings"""
+ regular_schedulers = self.filtered(lambda x: x.interval_type != "after_cancel")
+ res = super(EventMail, regular_schedulers).execute()
+ for scheduler in self.filtered(
+ lambda x: x.interval_type == "after_cancel"
+ and x.event_id.stage_id.is_cancelled
+ ):
+ # Get only registrations cancelled from the event button
+ registrations = (
+ scheduler.event_id.registration_ids.filtered("cancelled_from_event")
+ - scheduler.mail_registration_ids.registration_id
+ )
+ scheduler._create_missing_mail_registrations(registrations)
+ scheduler.mail_registration_ids.execute()
+ total_sent = len(
+ scheduler.mail_registration_ids.filtered(lambda reg: reg.mail_sent)
+ )
+ scheduler.update(
+ {
+ "mail_done": total_sent >= len(registrations),
+ "mail_count_done": total_sent,
+ }
+ )
+ return res
+
+
+class EventMailRegistration(models.Model):
+ _inherit = "event.mail.registration"
+
+ def execute(self):
+ """We don't have a very good hooks. This is almost rewritten from the original
+ just allows to send the mailing to the cancelled registrations"""
+ now = fields.Datetime.now()
+ regular = self.filtered(
+ lambda x: x.scheduler_id.interval_type != "after_cancel"
+ )
+ res = super(EventMailRegistration, regular).execute()
+ todo = self.filtered(
+ lambda x: x.scheduler_id.interval_type == "after_cancel"
+ and not x.mail_sent
+ and not x.registration_id.state == "draft"
+ and (x.scheduled_date and x.scheduled_date <= now)
+ and x.scheduler_id.notification_type == "mail"
+ )
+ for reg_mail in todo:
+ organizer = reg_mail.scheduler_id.event_id.organizer_id
+ company = self.env.company
+ author = self.env.ref("base.user_root")
+ if organizer.email:
+ author = organizer
+ elif company.email:
+ author = company.partner_id
+ elif self.env.user.email:
+ author = self.env.user
+ email_values = {
+ "author_id": author.id,
+ }
+ if not reg_mail.scheduler_id.template_ref.email_from:
+ email_values["email_from"] = author.email_formatted
+ reg_mail.scheduler_id.template_ref.send_mail(
+ reg_mail.registration_id.id, email_values=email_values
+ )
+ todo.write({"mail_sent": True})
+ return res
diff --git a/event_stage_cancelled/models/event_registration.py b/event_stage_cancelled/models/event_registration.py
new file mode 100644
index 000000000..0dda53aa4
--- /dev/null
+++ b/event_stage_cancelled/models/event_registration.py
@@ -0,0 +1,19 @@
+# Copyright 2024 Tecnativa S.L. - David Vidal
+# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
+from odoo import fields, models
+
+
+class EventRegistration(models.Model):
+ _inherit = "event.registration"
+
+ cancelled_from_event = fields.Boolean(
+ help="Technical field to distinguish those registrations which where cancelled "
+ "from the event so we can, for example send them scheduled mails after the "
+ "cancellation but not if the were cancelled before that"
+ )
+
+ def action_cancel(self):
+ res = super().action_cancel()
+ if self.env.context.get("cancelled_from_event"):
+ self.cancelled_from_event = True
+ return res
diff --git a/event_stage_cancelled/models/event_type_mail.py b/event_stage_cancelled/models/event_type_mail.py
new file mode 100644
index 000000000..1b4f51296
--- /dev/null
+++ b/event_stage_cancelled/models/event_type_mail.py
@@ -0,0 +1,12 @@
+# Copyright 2024 Tecnativa S.L. - David Vidal
+# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
+from odoo import fields, models
+
+
+class EventTypeMail(models.Model):
+ _inherit = "event.type.mail"
+
+ interval_type = fields.Selection(
+ selection_add=[("after_cancel", "After the event cancellation")],
+ ondelete={"after_cancel": "cascade"},
+ )
diff --git a/event_stage_cancelled/readme/CONFIGURE.md b/event_stage_cancelled/readme/CONFIGURE.md
index 8489b4c1b..c64304d85 100644
--- a/event_stage_cancelled/readme/CONFIGURE.md
+++ b/event_stage_cancelled/readme/CONFIGURE.md
@@ -2,3 +2,13 @@ To set a stage as cancelled:
- Go to *Events > Configuration > Event Stages* and choose the one you want to be
the cancelled one.
+
+To schedule a mail that triggers when the event is cancelled:
+
+- Go to *Events* and select an event.
+- Go to the *Communication* tab and add a new scheduler.
+- Choose to trigger it *After the event cancellation*.
+- Choose the other parameters like template or the interval.
+
+When the event is cancelled, the corresponding mail will be sent to the attendants
+who where confirmed at the moment of the cancellation.
diff --git a/event_stage_cancelled/readme/DESCRIPTION.md b/event_stage_cancelled/readme/DESCRIPTION.md
index 654f5c136..1557cdce0 100644
--- a/event_stage_cancelled/readme/DESCRIPTION.md
+++ b/event_stage_cancelled/readme/DESCRIPTION.md
@@ -1,2 +1,2 @@
-This module adds the posibility of flaggin an event stage as cancelled so we can hook
-workflows onto it.
+This module adds the posibility of flagging an event stage as cancelled so we can hook
+workflows onto it like cancelling registrations or scheduling special mail events.
diff --git a/event_stage_cancelled/static/description/icon.png b/event_stage_cancelled/static/description/icon.png
new file mode 100644
index 0000000000000000000000000000000000000000..3a0328b516c4980e8e44cdb63fd945757ddd132d
GIT binary patch
literal 9455
zcmW++2RxMjAAjx~&dlBk9S+%}OXg)AGE&Cb*&}d0jUxM@u(PQx^-s)697TX`ehR4?GS^qbkof1cslKgkU)h65qZ9Oc=ml_0temigYLJfnz{IDzUf>bGs4N!v3=Z3jMq&A#7%rM5eQ#dc?k~!
zVpnB`o+K7|Al`Q_U;eD$B
zfJtP*jH`siUq~{KE)`jP2|#TUEFGRryE2`i0**z#*^6~AI|YzIWy$Cu#CSLW3q=GA
z6`?GZymC;dCPk~rBS%eCb`5OLr;RUZ;D`}um=H)BfVIq%7VhiMr)_#G0N#zrNH|__
zc+blN2UAB0=617@>_u;MPHN;P;N#YoE=)R#i$k_`UAA>WWCcEVMh~L_
zj--gtp&|K1#58Yz*AHCTMziU1Jzt_jG0I@qAOHsk$2}yTmVkBp_eHuY$A9)>P6o~I
z%aQ?!(GqeQ-Y+b0I(m9pwgi(IIZZzsbMv+9w{PFtd_<_(LA~0H(xz{=FhLB@(1&qHA5EJw1>>=%q2f&^X>IQ{!GJ4e9U
z&KlB)z(84HmNgm2hg2C0>WM{E(DdPr+EeU_N@57;PC2&DmGFW_9kP&%?X4}+xWi)(
z;)z%wI5>D4a*5XwD)P--sPkoY(a~WBw;E~AW`Yue4kFa^LM3X`8x|}ZUeMnqr}>kH
zG%WWW>3ml$Yez?i%)2pbKPI7?5o?hydokgQyZsNEr{a|mLdt;X2TX(#B1j35xPnPW
z*bMSSOauW>o;*=kO8ojw91VX!qoOQb)zHJ!odWB}d+*K?#sY_jqPdg{Sm2HdYzdEx
zOGVPhVRTGPtv0o}RfVP;Nd(|CB)I;*t&QO8h
zFfekr30S!-LHmV_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UKym($a_7dJ?o+40*OLl^{=&oq$<#Q(yyrp
z{J-FAniyAw9tPbe&IhQ|a`DqFTVQGQ&Gq3!C2==4x{6EJwiPZ8zub-iXoUtkJiG{}
zPaR&}_fn8_z~(=;5lD-aPWD3z8PZS@AaUiomF!G8I}Mf>e~0g#BelA-5#`cj;O5>N
Xviia!U7SGha1wx#SCgwmn*{w2TRX*I
literal 0
HcmV?d00001
diff --git a/event_stage_cancelled/static/description/index.html b/event_stage_cancelled/static/description/index.html
index 768b81433..0b100c6bc 100644
--- a/event_stage_cancelled/static/description/index.html
+++ b/event_stage_cancelled/static/description/index.html
@@ -367,11 +367,12 @@ Event cancellation workflows
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-!! source digest: sha256:4883ca883b1049ca7e9f62f7aff2150e549d2186a7a2d6a942cd580fd82ef194
+!! source digest: sha256:2c6facd843a69eb5970fe525b81d5e5364d69baa69bdb84e31580e41f5312782
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->

-This module adds the posibility of flaggin an event stage as cancelled
-so we can hook workflows onto it.
+This module adds the posibility of flagging an event stage as cancelled
+so we can hook workflows onto it like cancelling registrations or
+scheduling special mail events.
Table of contents
@@ -402,6 +403,15 @@
- Go to Events > Configuration > Event Stages and choose the one you
want to be the cancelled one.
+
To schedule a mail that triggers when the event is cancelled:
+
+- Go to Events and select an event.
+- Go to the Communication tab and add a new scheduler.
+- Choose to trigger it After the event cancellation.
+- Choose the other parameters like template or the interval.
+
+
When the event is cancelled, the corresponding mail will be sent to the
+attendants who where confirmed at the moment of the cancellation.
diff --git a/event_stage_cancelled/tests/__init__.py b/event_stage_cancelled/tests/__init__.py
new file mode 100644
index 000000000..119a4d62f
--- /dev/null
+++ b/event_stage_cancelled/tests/__init__.py
@@ -0,0 +1 @@
+from . import test_event_stage_cancelled
diff --git a/event_stage_cancelled/tests/test_event_stage_cancelled.py b/event_stage_cancelled/tests/test_event_stage_cancelled.py
new file mode 100644
index 000000000..527038762
--- /dev/null
+++ b/event_stage_cancelled/tests/test_event_stage_cancelled.py
@@ -0,0 +1,86 @@
+# Copyright 2024 Tecnativa S.L. - David Vidal
+# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
+from odoo.tests import TransactionCase
+
+
+class TestEventCancelCase(TransactionCase):
+ @classmethod
+ def setUpClass(cls):
+ super().setUpClass()
+ cls.event = cls.env["event.event"].create(
+ {
+ "date_begin": "2024-05-06 09:00:00",
+ "date_end": "2024-05-08 18:00:00",
+ "name": "OCA DAYS",
+ }
+ )
+ # Let's prevent default schedulers that could distort our test case
+ cls.event.event_mail_ids.unlink()
+ cls.mail_template = cls.env["mail.template"].create(
+ {
+ "name": "Test event cancelled",
+ "model_id": cls.env.ref("event.model_event_registration").id,
+ # Just a test, the event will go perfectly. Join it!
+ "subject": "The event is cancelled!",
+ "body_html": "
We're sorry to announce that...
",
+ }
+ )
+ cls.event_mail = cls.env["event.mail"].create(
+ [
+ {
+ "event_id": cls.event.id,
+ "notification_type": "mail",
+ "interval_unit": "now",
+ "interval_type": "after_cancel",
+ "template_ref": f"mail.template, {cls.mail_template.id}",
+ }
+ ]
+ )
+ cls.attendees = cls.env["event.registration"].create(
+ [
+ {
+ "event_id": cls.event.id,
+ "name": f"Test attendee {reg}",
+ "email": f"test_attendee_{reg}@test.com",
+ }
+ for reg in range(5)
+ ]
+ )
+ (
+ cls.attendee_1,
+ cls.attendee_2,
+ cls.attendee_3,
+ cls.attendee_4,
+ cls.attendee_5,
+ ) = cls.attendees
+ # Let's add some variations
+ (cls.attendee_1 + cls.attendee_2).state = "draft"
+ (cls.attendee_3 + cls.attendee_4).state = "open"
+ cls.attendee_5.state = "cancel"
+
+ def test_event_cancellation(self):
+ """Test the processes triggered by the event cancellation"""
+ # Force the scheduler to see no effect (normally is handled by the cron)
+ self.event_mail.execute()
+ self.assertFalse(bool(self.event_mail.mail_registration_ids))
+ self.assertFalse(self.event_mail.scheduled_date)
+ self.assertEqual(self.event_mail.mail_state, "running")
+ # Inject bypass_reason for test compatibility with event_registration_cancel_reason
+ self.event.button_cancel()
+ self.assertTrue(
+ all([a.state == "cancel" for a in self.attendees]),
+ f"Not all the attendees are cancelled: "
+ f"{' / '.join([str((a.name, a.state)) for a in self.attendees])}",
+ )
+ # One attendee was already cancelled.
+ self.assertEqual(len(self.attendees.filtered("cancelled_from_event")), 4)
+ self.assertEqual(self.event_mail.mail_state, "scheduled")
+ # Force the scheduler. Normally is handled by the cron
+ self.event_mail.execute()
+ # Only the attendees that we just cancelled are going to be notified
+ self.assertEqual(
+ (self.attendee_1 + self.attendee_2 + self.attendee_3 + self.attendee_4),
+ self.event_mail.mail_registration_ids.registration_id,
+ )
+ self.assertEqual(self.event_mail.mail_state, "sent")
+ self.assertTrue(all(self.event_mail.mail_registration_ids.mapped("mail_sent")))
From 18aecb3fa42d9189da8b526e69708b4bf65b9d69 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?V=C3=ADctor=20Mart=C3=ADnez?=
Date: Wed, 11 Dec 2024 13:52:24 +0100
Subject: [PATCH 3/9] [IMP] event_stage_cancelled: pre-commit auto fixes
---
event_stage_cancelled/pyproject.toml | 3 +++
1 file changed, 3 insertions(+)
create mode 100644 event_stage_cancelled/pyproject.toml
diff --git a/event_stage_cancelled/pyproject.toml b/event_stage_cancelled/pyproject.toml
new file mode 100644
index 000000000..4231d0ccc
--- /dev/null
+++ b/event_stage_cancelled/pyproject.toml
@@ -0,0 +1,3 @@
+[build-system]
+requires = ["whool"]
+build-backend = "whool.buildapi"
From 2a76830870dd8c178ea9172c3da3359871e537f7 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?V=C3=ADctor=20Mart=C3=ADnez?=
Date: Wed, 11 Dec 2024 13:55:45 +0100
Subject: [PATCH 4/9] [MIG] event_stage_cancelled: Migration to 17.0
TT51925
---
event_stage_cancelled/README.rst | 10 +++++-----
event_stage_cancelled/__manifest__.py | 2 +-
.../data/mail_template_data.xml | 2 +-
event_stage_cancelled/models/event_mail.py | 11 +++++------
.../static/description/index.html | 18 ++++++++++--------
.../tests/test_event_stage_cancelled.py | 7 ++++---
.../views/event_event_views.xml | 2 +-
7 files changed, 27 insertions(+), 25 deletions(-)
diff --git a/event_stage_cancelled/README.rst b/event_stage_cancelled/README.rst
index 255dcc05c..6f14e5fe8 100644
--- a/event_stage_cancelled/README.rst
+++ b/event_stage_cancelled/README.rst
@@ -17,13 +17,13 @@ Event cancellation workflows
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fevent-lightgray.png?logo=github
- :target: https://github.com/OCA/event/tree/15.0/event_stage_cancelled
+ :target: https://github.com/OCA/event/tree/17.0/event_stage_cancelled
:alt: OCA/event
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
- :target: https://translation.odoo-community.org/projects/event-15-0/event-15-0-event_stage_cancelled
+ :target: https://translation.odoo-community.org/projects/event-17-0/event-17-0-event_stage_cancelled
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
- :target: https://runboat.odoo-community.org/builds?repo=OCA/event&target_branch=15.0
+ :target: https://runboat.odoo-community.org/builds?repo=OCA/event&target_branch=17.0
:alt: Try me on Runboat
|badge1| |badge2| |badge3| |badge4| |badge5|
@@ -86,7 +86,7 @@ Bug Tracker
Bugs are tracked on `GitHub Issues `_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomed
-`feedback `_.
+`feedback `_.
Do not contact contributors directly about support or help with technical issues.
@@ -118,6 +118,6 @@ OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.
-This module is part of the `OCA/event `_ project on GitHub.
+This module is part of the `OCA/event `_ project on GitHub.
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
diff --git a/event_stage_cancelled/__manifest__.py b/event_stage_cancelled/__manifest__.py
index e23640456..be5338bef 100644
--- a/event_stage_cancelled/__manifest__.py
+++ b/event_stage_cancelled/__manifest__.py
@@ -2,7 +2,7 @@
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
{
"name": "Event cancellation workflows",
- "version": "15.0.1.0.0",
+ "version": "17.0.1.0.0",
"category": "Marketing",
"author": "Tecnativa, Odoo Community Association (OCA)",
"website": "https://github.com/OCA/event",
diff --git a/event_stage_cancelled/data/mail_template_data.xml b/event_stage_cancelled/data/mail_template_data.xml
index bf9b2499a..a5a6d1510 100644
--- a/event_stage_cancelled/data/mail_template_data.xml
+++ b/event_stage_cancelled/data/mail_template_data.xml
@@ -179,6 +179,6 @@
- {{ object.partner_id.lang }}
+ {{ object.event_id.lang or object.partner_id.lang }}
diff --git a/event_stage_cancelled/models/event_mail.py b/event_stage_cancelled/models/event_mail.py
index f9d1ca910..1a2e9ac7f 100644
--- a/event_stage_cancelled/models/event_mail.py
+++ b/event_stage_cancelled/models/event_mail.py
@@ -79,20 +79,19 @@ def execute(self):
for reg_mail in todo:
organizer = reg_mail.scheduler_id.event_id.organizer_id
company = self.env.company
- author = self.env.ref("base.user_root")
+ author = self.env.ref("base.user_root").partner_id
if organizer.email:
author = organizer
elif company.email:
author = company.partner_id
elif self.env.user.email:
- author = self.env.user
+ author = self.env.user.partner_id
email_values = {
"author_id": author.id,
}
- if not reg_mail.scheduler_id.template_ref.email_from:
+ template = reg_mail.scheduler_id.template_ref
+ if not template.email_from:
email_values["email_from"] = author.email_formatted
- reg_mail.scheduler_id.template_ref.send_mail(
- reg_mail.registration_id.id, email_values=email_values
- )
+ template.send_mail(reg_mail.registration_id.id, email_values=email_values)
todo.write({"mail_sent": True})
return res
diff --git a/event_stage_cancelled/static/description/index.html b/event_stage_cancelled/static/description/index.html
index 0b100c6bc..de16f98a4 100644
--- a/event_stage_cancelled/static/description/index.html
+++ b/event_stage_cancelled/static/description/index.html
@@ -1,4 +1,3 @@
-
@@ -9,10 +8,11 @@
/*
:Author: David Goodger (goodger@python.org)
-:Id: $Id: html4css1.css 8954 2022-01-20 10:10:25Z milde $
+:Id: $Id: html4css1.css 9511 2024-01-13 09:50:07Z milde $
:Copyright: This stylesheet has been placed in the public domain.
Default cascading style sheet for the HTML output of Docutils.
+Despite the name, some widely supported CSS2 features are used.
See https://docutils.sourceforge.io/docs/howto/html-stylesheets.html for how to
customize this style sheet.
@@ -275,7 +275,7 @@
margin-left: 2em ;
margin-right: 2em }
-pre.code .ln { color: grey; } /* line numbers */
+pre.code .ln { color: gray; } /* line numbers */
pre.code, code { background-color: #eeeeee }
pre.code .comment, code .comment { color: #5C6576 }
pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold }
@@ -301,7 +301,7 @@
span.pre {
white-space: pre }
-span.problematic {
+span.problematic, pre.problematic {
color: red }
span.section-subtitle {
@@ -369,7 +369,7 @@ Event cancellation workflows
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:2c6facd843a69eb5970fe525b81d5e5364d69baa69bdb84e31580e41f5312782
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
-

+

This module adds the posibility of flagging an event stage as cancelled
so we can hook workflows onto it like cancelling registrations or
scheduling special mail events.
@@ -434,7 +434,7 @@
Bugs are tracked on GitHub Issues.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomed
-feedback.
+feedback.
Do not contact contributors directly about support or help with technical issues.
@@ -457,11 +457,13 @@
This module is maintained by the OCA.
-

+
+
+
OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.
-
This module is part of the OCA/event project on GitHub.
+
This module is part of the OCA/event project on GitHub.
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
diff --git a/event_stage_cancelled/tests/test_event_stage_cancelled.py b/event_stage_cancelled/tests/test_event_stage_cancelled.py
index 527038762..4f2918c35 100644
--- a/event_stage_cancelled/tests/test_event_stage_cancelled.py
+++ b/event_stage_cancelled/tests/test_event_stage_cancelled.py
@@ -1,9 +1,9 @@
# Copyright 2024 Tecnativa S.L. - David Vidal
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
-from odoo.tests import TransactionCase
+from odoo.addons.base.tests.common import BaseCommon
-class TestEventCancelCase(TransactionCase):
+class TestEventCancelCase(BaseCommon):
@classmethod
def setUpClass(cls):
super().setUpClass()
@@ -65,7 +65,8 @@ def test_event_cancellation(self):
self.assertFalse(bool(self.event_mail.mail_registration_ids))
self.assertFalse(self.event_mail.scheduled_date)
self.assertEqual(self.event_mail.mail_state, "running")
- # Inject bypass_reason for test compatibility with event_registration_cancel_reason
+ # Inject bypass_reason for test compatibility
+ # with event_registration_cancel_reason
self.event.button_cancel()
self.assertTrue(
all([a.state == "cancel" for a in self.attendees]),
diff --git a/event_stage_cancelled/views/event_event_views.xml b/event_stage_cancelled/views/event_event_views.xml
index 23350958a..1a2651205 100644
--- a/event_stage_cancelled/views/event_event_views.xml
+++ b/event_stage_cancelled/views/event_event_views.xml
@@ -11,7 +11,7 @@
name="button_cancel"
type="object"
confirm="Are you sure you want to cancel this event? All the linked attendees will be cancelled as well."
- attrs="{'invisible': [('show_cancel_button', '=', False)]}"
+ invisible="not show_cancel_button"
/>
From 3e9ef186e3501496dc2802cba24707a8784ddbba Mon Sep 17 00:00:00 2001
From: oca-ci
Date: Wed, 11 Dec 2024 16:54:17 +0000
Subject: [PATCH 5/9] [UPD] Update event_stage_cancelled.pot
---
event_stage_cancelled/README.rst | 26 +-
event_stage_cancelled/i18n/es.po | 471 ++++++++++++------
.../i18n/event_stage_cancelled.pot | 34 +-
.../static/description/index.html | 2 +-
4 files changed, 336 insertions(+), 197 deletions(-)
diff --git a/event_stage_cancelled/README.rst b/event_stage_cancelled/README.rst
index 6f14e5fe8..4e3c86b24 100644
--- a/event_stage_cancelled/README.rst
+++ b/event_stage_cancelled/README.rst
@@ -7,7 +7,7 @@ Event cancellation workflows
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
- !! source digest: sha256:2c6facd843a69eb5970fe525b81d5e5364d69baa69bdb84e31580e41f5312782
+ !! source digest: sha256:215ccf9ff3805b28dd2784676cd51483becf64b645161e4d37fbcd93f2cfbccf
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
@@ -50,15 +50,15 @@ Configuration
To set a stage as cancelled:
-- Go to *Events > Configuration > Event Stages* and choose the one you
- want to be the cancelled one.
+- Go to *Events > Configuration > Event Stages* and choose the one you
+ want to be the cancelled one.
To schedule a mail that triggers when the event is cancelled:
-- Go to *Events* and select an event.
-- Go to the *Communication* tab and add a new scheduler.
-- Choose to trigger it *After the event cancellation*.
-- Choose the other parameters like template or the interval.
+- Go to *Events* and select an event.
+- Go to the *Communication* tab and add a new scheduler.
+- Choose to trigger it *After the event cancellation*.
+- Choose the other parameters like template or the interval.
When the event is cancelled, the corresponding mail will be sent to the
attendants who where confirmed at the moment of the cancellation.
@@ -75,10 +75,10 @@ registrations will be cancelled as well.
Known issues / Roadmap
======================
-- If you just change the stage to the cancelled one, the registrations
- won't be cancelled. This is avoided for the moment on purpose as a
- confirmation dialog would require an special ``ir.actions.client``
- implementation.
+- If you just change the stage to the cancelled one, the registrations
+ won't be cancelled. This is avoided for the moment on purpose as a
+ confirmation dialog would require an special ``ir.actions.client``
+ implementation.
Bug Tracker
===========
@@ -101,9 +101,9 @@ Authors
Contributors
------------
-- `Tecnativa `__
+- `Tecnativa `__
- - David Vidal
+ - David Vidal
Maintainers
-----------
diff --git a/event_stage_cancelled/i18n/es.po b/event_stage_cancelled/i18n/es.po
index 2a32467dd..0d2f9a58a 100644
--- a/event_stage_cancelled/i18n/es.po
+++ b/event_stage_cancelled/i18n/es.po
@@ -20,18 +20,18 @@ msgstr ""
#. module: event_stage_cancelled
#: model:mail.template,body_html:event_stage_cancelled.event_cancelled
msgid ""
-" |
| \n"
"\n"
+"date_begin, tz='UTC', dt_format="yyyyMMdd'T'HHmmss'Z'")\">\n"
"\n"
+"tz='UTC', dt_format="yyyyMMdd'T'HHmmss'Z'")\">\n"
"\n"
-"\n"
-"\n"
+"object.event_id.is_published\">\n"
+"\n"
+"\n"
"\n"
" | \n"
@@ -79,7 +79,7 @@ msgid ""
"
| \n"
" |
\n"
"
\n"
@@ -155,142 +155,10 @@ msgid ""
"\n"
" "
msgstr ""
-"\n"
-"\n"
-"\n"
-"\n"
-"\n"
-"\n"
-"\n"
-"\n"
-"\n"
-"\n"
-" \n"
-" \n"
-" \n"
-" Su registro \n"
-" Oscar Morgan\n"
-" | \n"
-" \n"
-" \n"
-" Ver evento\n"
-" \n"
-" \n"
-" \n"
-" \n"
-" \n"
-" | \n"
-" \n"
-" \n"
-" | \n"
-" \n"
-" | \n"
-" \n"
-"\n"
-"\n"
-" \n"
-" \n"
-" \n"
-" \n"
-" Hola, Oscar Morgan."
-" \n"
-" Lamentamos informarle de que el evento \n"
-" \n"
-" OpenWood Collection Online Reveal\n"
-" \n"
-" \n"
-" OpenWood Collection Online Reveal\n"
-" \n"
-" ha sido cancelado.\n"
-" \n"
-" \n"
-" \n"
-" \n"
-" Por favor, no dude en ponerse en contacto con "
-"el organizador para más información: \n"
-" \n"
-" - Tu "
-"compañía
\n"
-" \n"
-" - Correo:
\n"
-" \n"
-" \n"
-" - Teléfono:
\n"
-" \n"
-" \n"
-" \n"
-" \n"
-" \n"
-" Entendemos los inconvenientes que esto pueda causar y "
-"pedimos sinceras disculpas por cualquier molestia ocasionada. \n"
-" \n"
-" -- \n"
-" \n"
-" Tu "
-"compañía\n"
-" \n"
-" \n"
-" El equipo de OpenWood Collection Online Reveal\n"
-" \n"
-" \n"
-" \n"
-" | \n"
-" \n"
-" | \n"
-" \n"
-"\n"
-" \n"
-" |
\n"
-"\n"
-"| \n"
-"\n"
-" |
\n"
-"
\n"
-" "
#. module: event_stage_cancelled
#: model:ir.model.fields.selection,name:event_stage_cancelled.selection__event_mail__interval_type__after_cancel
+#: model:ir.model.fields.selection,name:event_stage_cancelled.selection__event_mail_scheduler_template__interval_type__after_cancel
#: model:ir.model.fields.selection,name:event_stage_cancelled.selection__event_type_mail__interval_type__after_cancel
msgid "After the event cancellation"
msgstr "Tras la cancelación del evento"
@@ -298,8 +166,8 @@ msgstr "Tras la cancelación del evento"
#. module: event_stage_cancelled
#: model_terms:ir.ui.view,arch_db:event_stage_cancelled.view_event_form
msgid ""
-"Are you sure you want to cancel this event? All the linked attendees will "
-"be cancelled as well."
+"Are you sure you want to cancel this event? All the linked attendees will be "
+"cancelled as well."
msgstr ""
"¿Está seguro que quiere cancelar este evento? Todos los asistentes "
"vinculados serán cancelados también."
@@ -383,6 +251,7 @@ msgstr "Activador"
#. module: event_stage_cancelled
#: model:ir.model.fields,field_description:event_stage_cancelled.field_event_mail__interval_type
+#: model:ir.model.fields,field_description:event_stage_cancelled.field_event_mail_scheduler_template__interval_type
msgid "Trigger "
msgstr "Desencadenar "
@@ -390,3 +259,275 @@ msgstr "Desencadenar "
#: model:mail.template,subject:event_stage_cancelled.event_cancelled
msgid "{{ object.event_id.name }}: event cancelled"
msgstr "{{ object.event_id.name }}: evento cancelado"
+
+#~ msgid ""
+#~ "\n"
+#~ "\n"
+#~ "\n"
+#~ "\n"
+#~ "\n"
+#~ "\n"
+#~ "\n"
+#~ "\n"
+#~ "\n"
+#~ "\n"
+#~ " \n"
+#~ " \n"
+#~ " \n"
+#~ " Your registration"
+#~ "span> \n"
+#~ " Oscar Morgan\n"
+#~ " | \n"
+#~ " \n"
+#~ " \n"
+#~ " View Event\n"
+#~ " \n"
+#~ " \n"
+#~ " \n"
+#~ " \n"
+#~ " \n"
+#~ " | \n"
+#~ " \n"
+#~ " \n"
+#~ " | \n"
+#~ " \n"
+#~ " | \n"
+#~ " \n"
+#~ "\n"
+#~ "\n"
+#~ " \n"
+#~ " \n"
+#~ " \n"
+#~ " \n"
+#~ " Hello Oscar Morgan,"
+#~ " \n"
+#~ " We are sorry to inform you that the\n"
+#~ " \n"
+#~ " OpenWood Collection Online Reveal\n"
+#~ " \n"
+#~ " \n"
+#~ " OpenWood Collection Online Reveal\n"
+#~ " \n"
+#~ " has been cancelled.\n"
+#~ " \n"
+#~ " \n"
+#~ " \n"
+#~ " \n"
+#~ " Please do not hesitate to contact the "
+#~ "organizer at for further information: \n"
+#~ " \n"
+#~ " - YourCompany
\n"
+#~ " \n"
+#~ " - Mail:
\n"
+#~ " \n"
+#~ " \n"
+#~ " - Phone:
\n"
+#~ " \n"
+#~ " \n"
+#~ " \n"
+#~ " \n"
+#~ " \n"
+#~ " We understand the inconvenience this may cause and "
+#~ "sincerely apologize for any disappointment. \n"
+#~ " \n"
+#~ " -- \n"
+#~ " \n"
+#~ " YourCompany\n"
+#~ " \n"
+#~ " \n"
+#~ " The OpenWood Collection Online Reveal Team\n"
+#~ " \n"
+#~ " \n"
+#~ " \n"
+#~ " | \n"
+#~ " \n"
+#~ " | \n"
+#~ " \n"
+#~ "\n"
+#~ " \n"
+#~ " |
\n"
+#~ "\n"
+#~ "| \n"
+#~ "\n"
+#~ " |
\n"
+#~ "
\n"
+#~ " "
+#~ msgstr ""
+#~ "\n"
+#~ "\n"
+#~ "\n"
+#~ "\n"
+#~ "\n"
+#~ "\n"
+#~ "\n"
+#~ "\n"
+#~ "\n"
+#~ "\n"
+#~ " \n"
+#~ " \n"
+#~ " \n"
+#~ " Su registro \n"
+#~ " Oscar Morgan\n"
+#~ " | \n"
+#~ " \n"
+#~ " \n"
+#~ " Ver evento\n"
+#~ " \n"
+#~ " \n"
+#~ " \n"
+#~ " \n"
+#~ " \n"
+#~ " | \n"
+#~ " \n"
+#~ " \n"
+#~ " | \n"
+#~ " \n"
+#~ " | \n"
+#~ " \n"
+#~ "\n"
+#~ "\n"
+#~ " \n"
+#~ " \n"
+#~ " \n"
+#~ " \n"
+#~ " Hola, Oscar Morgan."
+#~ " \n"
+#~ " Lamentamos informarle de que el evento \n"
+#~ " \n"
+#~ " OpenWood Collection Online Reveal\n"
+#~ " \n"
+#~ " \n"
+#~ " OpenWood Collection Online Reveal\n"
+#~ " \n"
+#~ " ha sido cancelado.\n"
+#~ " \n"
+#~ " \n"
+#~ " \n"
+#~ " \n"
+#~ " Por favor, no dude en ponerse en contacto "
+#~ "con el organizador para más información: \n"
+#~ " \n"
+#~ " - Tu "
+#~ "compañía
\n"
+#~ " \n"
+#~ " - Correo:
\n"
+#~ " \n"
+#~ " \n"
+#~ " - Teléfono:
\n"
+#~ " \n"
+#~ " \n"
+#~ " \n"
+#~ " \n"
+#~ " \n"
+#~ " Entendemos los inconvenientes que esto pueda causar y "
+#~ "pedimos sinceras disculpas por cualquier molestia ocasionada. \n"
+#~ " \n"
+#~ " -- \n"
+#~ " \n"
+#~ " Tu "
+#~ "compañía\n"
+#~ " \n"
+#~ " \n"
+#~ " El equipo de OpenWood Collection Online Reveal\n"
+#~ " \n"
+#~ " \n"
+#~ " \n"
+#~ " | \n"
+#~ " \n"
+#~ " | \n"
+#~ " \n"
+#~ "\n"
+#~ " \n"
+#~ " |
\n"
+#~ "\n"
+#~ "| \n"
+#~ "\n"
+#~ " |
\n"
+#~ "
\n"
+#~ " "
diff --git a/event_stage_cancelled/i18n/event_stage_cancelled.pot b/event_stage_cancelled/i18n/event_stage_cancelled.pot
index 5d0820a6f..81bcbeb33 100644
--- a/event_stage_cancelled/i18n/event_stage_cancelled.pot
+++ b/event_stage_cancelled/i18n/event_stage_cancelled.pot
@@ -4,7 +4,7 @@
#
msgid ""
msgstr ""
-"Project-Id-Version: Odoo Server 15.0\n"
+"Project-Id-Version: Odoo Server 17.0\n"
"Report-Msgid-Bugs-To: \n"
"Last-Translator: \n"
"Language-Team: \n"
@@ -17,11 +17,11 @@ msgstr ""
#: model:mail.template,body_html:event_stage_cancelled.event_cancelled
msgid ""
"\n"
-"\n"
-"\n"
-"\n"
-"\n"
-"\n"
+"\n"
+"\n"
+"\n"
+"\n"
+"\n"
"\n"
"\n"
"\n"
@@ -29,7 +29,7 @@ msgid ""
" \n"
" \n"
" \n"
-" Your registration \n"
+" Your registration \n"
" Oscar Morgan\n"
" | \n"
" \n"
@@ -38,11 +38,11 @@ msgid ""
" \n"
" \n"
" \n"
-" \n"
+" \n"
" \n"
" | \n"
" \n"
-" \n"
+" \n"
" | \n"
" \n"
" | \n"
@@ -53,7 +53,7 @@ msgid ""
" \n"
" \n"
" \n"
-" Hello Oscar Morgan, \n"
+" Hello Oscar Morgan, \n"
" We are sorry to inform you that the\n"
" \n"
" OpenWood Collection Online Reveal\n"
@@ -65,23 +65,23 @@ msgid ""
" \n"
" \n"
" \n"
-" \n"
+" \n"
" Please do not hesitate to contact the organizer at for further information: \n"
" \n"
" - YourCompany
\n"
" \n"
-" - Mail:
\n"
+" - Mail:
\n"
" \n"
" \n"
-" - Phone:
\n"
+" - Phone:
\n"
" \n"
" \n"
" \n"
" \n"
" \n"
-" We understand the inconvenience this may cause and sincerely apologize for any disappointment. \n"
+" We understand the inconvenience this may cause and sincerely apologize for any disappointment. \n"
" \n"
-" -- \n"
+" -- \n"
" \n"
" YourCompany\n"
" \n"
@@ -103,7 +103,7 @@ msgid ""
" \n"
" Sent by YourCompany\n"
" \n"
-" \n"
+" \n"
" Discover all our events.\n"
" \n"
" | \n"
@@ -179,7 +179,6 @@ msgstr ""
#. module: event_stage_cancelled
#: model:ir.model.fields,field_description:event_stage_cancelled.field_event_event__show_cancel_button
-#: model:ir.model.fields,field_description:event_stage_cancelled.field_event_session__show_cancel_button
msgid "Show Cancel Button"
msgstr ""
@@ -204,7 +203,6 @@ msgstr ""
#. module: event_stage_cancelled
#: model:ir.model.fields,field_description:event_stage_cancelled.field_event_mail__interval_type
#: model:ir.model.fields,field_description:event_stage_cancelled.field_event_mail_scheduler_template__interval_type
-#: model:ir.model.fields,field_description:event_stage_cancelled.field_event_mail_session__interval_type
msgid "Trigger "
msgstr ""
diff --git a/event_stage_cancelled/static/description/index.html b/event_stage_cancelled/static/description/index.html
index de16f98a4..ad71cfe49 100644
--- a/event_stage_cancelled/static/description/index.html
+++ b/event_stage_cancelled/static/description/index.html
@@ -367,7 +367,7 @@ Event cancellation workflows
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-!! source digest: sha256:2c6facd843a69eb5970fe525b81d5e5364d69baa69bdb84e31580e41f5312782
+!! source digest: sha256:215ccf9ff3805b28dd2784676cd51483becf64b645161e4d37fbcd93f2cfbccf
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->

This module adds the posibility of flagging an event stage as cancelled
From b70077d367565d2994e30385d83c4e794309fb79 Mon Sep 17 00:00:00 2001
From: mymage
Date: Thu, 12 Dec 2024 09:23:51 +0000
Subject: [PATCH 6/9] Added translation using Weblate (Italian)
---
event_stage_cancelled/i18n/it.po | 213 +++++++++++++++++++++++++++++++
1 file changed, 213 insertions(+)
create mode 100644 event_stage_cancelled/i18n/it.po
diff --git a/event_stage_cancelled/i18n/it.po b/event_stage_cancelled/i18n/it.po
new file mode 100644
index 000000000..54a59b586
--- /dev/null
+++ b/event_stage_cancelled/i18n/it.po
@@ -0,0 +1,213 @@
+# Translation of Odoo Server.
+# This file contains the translation of the following modules:
+# * event_stage_cancelled
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: Odoo Server 17.0\n"
+"Report-Msgid-Bugs-To: \n"
+"Last-Translator: Automatically generated\n"
+"Language-Team: none\n"
+"Language: it\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: \n"
+"Plural-Forms: nplurals=2; plural=n != 1;\n"
+
+#. module: event_stage_cancelled
+#: model:mail.template,body_html:event_stage_cancelled.event_cancelled
+msgid ""
+"\n"
+"\n"
+"\n"
+"\n"
+"\n"
+"\n"
+"\n"
+"\n"
+"\n"
+"\n"
+" \n"
+" \n"
+" \n"
+" Your registration \n"
+" Oscar Morgan\n"
+" | \n"
+" \n"
+" \n"
+" View Event\n"
+" \n"
+" \n"
+" \n"
+" \n"
+" \n"
+" | \n"
+" \n"
+" \n"
+" | \n"
+" \n"
+" | \n"
+" \n"
+"\n"
+"\n"
+" \n"
+" \n"
+" \n"
+" \n"
+" Hello Oscar Morgan, \n"
+" We are sorry to inform you that the\n"
+" \n"
+" OpenWood Collection Online Reveal\n"
+" \n"
+" \n"
+" OpenWood Collection Online Reveal\n"
+" \n"
+" has been cancelled.\n"
+" \n"
+" \n"
+" \n"
+" \n"
+" Please do not hesitate to contact the organizer at for further information: \n"
+" \n"
+" - YourCompany
\n"
+" \n"
+" - Mail:
\n"
+" \n"
+" \n"
+" - Phone:
\n"
+" \n"
+" \n"
+" \n"
+" \n"
+" \n"
+" We understand the inconvenience this may cause and sincerely apologize for any disappointment. \n"
+" \n"
+" -- \n"
+" \n"
+" YourCompany\n"
+" \n"
+" \n"
+" The OpenWood Collection Online Reveal Team\n"
+" \n"
+" \n"
+" \n"
+" | \n"
+" \n"
+" | \n"
+" \n"
+"\n"
+" \n"
+" | \n"
+"\n"
+"| \n"
+"\n"
+" | \n"
+" \n"
+" "
+msgstr ""
+
+#. module: event_stage_cancelled
+#: model:ir.model.fields.selection,name:event_stage_cancelled.selection__event_mail__interval_type__after_cancel
+#: model:ir.model.fields.selection,name:event_stage_cancelled.selection__event_mail_scheduler_template__interval_type__after_cancel
+#: model:ir.model.fields.selection,name:event_stage_cancelled.selection__event_type_mail__interval_type__after_cancel
+msgid "After the event cancellation"
+msgstr ""
+
+#. module: event_stage_cancelled
+#: model_terms:ir.ui.view,arch_db:event_stage_cancelled.view_event_form
+msgid ""
+"Are you sure you want to cancel this event? All the linked attendees will be"
+" cancelled as well."
+msgstr ""
+
+#. module: event_stage_cancelled
+#: model_terms:ir.ui.view,arch_db:event_stage_cancelled.view_event_form
+msgid "Cancel Event"
+msgstr ""
+
+#. module: event_stage_cancelled
+#: model:ir.model.fields,field_description:event_stage_cancelled.field_event_registration__cancelled_from_event
+msgid "Cancelled From Event"
+msgstr ""
+
+#. module: event_stage_cancelled
+#: model:ir.model,name:event_stage_cancelled.model_event_event
+msgid "Event"
+msgstr ""
+
+#. module: event_stage_cancelled
+#: model:ir.model,name:event_stage_cancelled.model_event_mail
+msgid "Event Automated Mailing"
+msgstr ""
+
+#. module: event_stage_cancelled
+#: model:ir.model,name:event_stage_cancelled.model_event_registration
+msgid "Event Registration"
+msgstr ""
+
+#. module: event_stage_cancelled
+#: model:ir.model,name:event_stage_cancelled.model_event_stage
+msgid "Event Stage"
+msgstr ""
+
+#. module: event_stage_cancelled
+#: model:mail.template,name:event_stage_cancelled.event_cancelled
+msgid "Event: Cancelled"
+msgstr ""
+
+#. module: event_stage_cancelled
+#: model:ir.model.fields,field_description:event_stage_cancelled.field_event_stage__is_cancelled
+msgid "Is Cancelled"
+msgstr ""
+
+#. module: event_stage_cancelled
+#: model:ir.model,name:event_stage_cancelled.model_event_type_mail
+msgid "Mail Scheduling on Event Category"
+msgstr ""
+
+#. module: event_stage_cancelled
+#: model:ir.model,name:event_stage_cancelled.model_event_mail_registration
+msgid "Registration Mail Scheduler"
+msgstr ""
+
+#. module: event_stage_cancelled
+#: model:ir.model.fields,field_description:event_stage_cancelled.field_event_event__show_cancel_button
+msgid "Show Cancel Button"
+msgstr ""
+
+#. module: event_stage_cancelled
+#: model:ir.model.fields,help:event_stage_cancelled.field_event_registration__cancelled_from_event
+msgid ""
+"Technical field to distinguish those registrations which where cancelled "
+"from the event so we can, for example send them scheduled mails after the "
+"cancellation but not if the were cancelled before that"
+msgstr ""
+
+#. module: event_stage_cancelled
+#: model:ir.model.fields,help:event_stage_cancelled.field_event_stage__is_cancelled
+msgid "The event is cancelled"
+msgstr ""
+
+#. module: event_stage_cancelled
+#: model:ir.model.fields,field_description:event_stage_cancelled.field_event_type_mail__interval_type
+msgid "Trigger"
+msgstr ""
+
+#. module: event_stage_cancelled
+#: model:ir.model.fields,field_description:event_stage_cancelled.field_event_mail__interval_type
+#: model:ir.model.fields,field_description:event_stage_cancelled.field_event_mail_scheduler_template__interval_type
+msgid "Trigger "
+msgstr ""
+
+#. module: event_stage_cancelled
+#: model:mail.template,subject:event_stage_cancelled.event_cancelled
+msgid "{{ object.event_id.name }}: event cancelled"
+msgstr ""
From 62c4634e2cef8aa27f0cd172ac9e6e2f54f32325 Mon Sep 17 00:00:00 2001
From: mymage
Date: Thu, 12 Dec 2024 09:36:27 +0000
Subject: [PATCH 7/9] Translated using Weblate (Italian)
Currently translated at 100.0% (19 of 19 strings)
Translation: event-17.0/event-17.0-event_stage_cancelled
Translate-URL: https://translation.odoo-community.org/projects/event-17-0/event-17-0-event_stage_cancelled/it/
---
event_stage_cancelled/i18n/it.po | 176 ++++++++++++++++++++++++++++---
1 file changed, 159 insertions(+), 17 deletions(-)
diff --git a/event_stage_cancelled/i18n/it.po b/event_stage_cancelled/i18n/it.po
index 54a59b586..b17d8ba2b 100644
--- a/event_stage_cancelled/i18n/it.po
+++ b/event_stage_cancelled/i18n/it.po
@@ -6,13 +6,15 @@ msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 17.0\n"
"Report-Msgid-Bugs-To: \n"
-"Last-Translator: Automatically generated\n"
+"PO-Revision-Date: 2024-12-12 10:06+0000\n"
+"Last-Translator: mymage \n"
"Language-Team: none\n"
"Language: it\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
+"X-Generator: Weblate 5.6.2\n"
#. module: event_stage_cancelled
#: model:mail.template,body_html:event_stage_cancelled.event_cancelled
@@ -113,13 +115,148 @@ msgid ""
" | \n"
" "
msgstr ""
+"\n"
+"\n"
+"\n"
+"\n"
+"\n"
+"\n"
+"\n"
+"\n"
+"\n"
+"\n"
+" \n"
+" \n"
+" \n"
+" Vostra "
+"registrazione \n"
+" Oscar Morgan\n"
+" | \n"
+" \n"
+" \n"
+" Visualizza evento\n"
+" \n"
+" \n"
+" \n"
+" \n"
+" \n"
+" | \n"
+" \n"
+" \n"
+" | \n"
+" \n"
+" | \n"
+" \n"
+"\n"
+"\n"
+" \n"
+" \n"
+" \n"
+" \n"
+" Salve Oscar "
+"Morgan, \n"
+" siamo spiacenti di avvisare che l'evento\n"
+" \n"
+" OpenWood Collection Online Reveal\n"
+" \n"
+" \n"
+" OpenWood Collection Online Reveal\n"
+" \n"
+" è stato annullato.\n"
+" \n"
+" \n"
+" \n"
+" \n"
+" Non esiti a contattare l'organizzatore per "
+"ulteriori informazioni: \n"
+" \n"
+" - YourCompany
\n"
+" \n"
+" - E-mail:
\n"
+" \n"
+" \n"
+" - Telefono:
\n"
+" \n"
+" \n"
+" \n"
+" \n"
+" \n"
+" Comprendiamo l'inconveniente che potrà causare e ci "
+"scusiamo sinceramente per la sua delusione. \n"
+" \n"
+" -- \n"
+" \n"
+" YourCompany\n"
+" \n"
+" \n"
+" The OpenWood "
+"Collection Online Reveal Team\n"
+" \n"
+" \n"
+" \n"
+" | \n"
+" \n"
+" | \n"
+" \n"
+"\n"
+" \n"
+" | \n"
+"\n"
+"| \n"
+"\n"
+" | \n"
+" \n"
+" "
#. module: event_stage_cancelled
#: model:ir.model.fields.selection,name:event_stage_cancelled.selection__event_mail__interval_type__after_cancel
#: model:ir.model.fields.selection,name:event_stage_cancelled.selection__event_mail_scheduler_template__interval_type__after_cancel
#: model:ir.model.fields.selection,name:event_stage_cancelled.selection__event_type_mail__interval_type__after_cancel
msgid "After the event cancellation"
-msgstr ""
+msgstr "Dopo la annullamento dell'evento"
#. module: event_stage_cancelled
#: model_terms:ir.ui.view,arch_db:event_stage_cancelled.view_event_form
@@ -127,61 +264,63 @@ msgid ""
"Are you sure you want to cancel this event? All the linked attendees will be"
" cancelled as well."
msgstr ""
+"Si è sicuri di voler annullare questo evento? Verranno annullati anche tutti "
+"i partecipanti collegati."
#. module: event_stage_cancelled
#: model_terms:ir.ui.view,arch_db:event_stage_cancelled.view_event_form
msgid "Cancel Event"
-msgstr ""
+msgstr "Annulla evento"
#. module: event_stage_cancelled
#: model:ir.model.fields,field_description:event_stage_cancelled.field_event_registration__cancelled_from_event
msgid "Cancelled From Event"
-msgstr ""
+msgstr "Annullato dall'evento"
#. module: event_stage_cancelled
#: model:ir.model,name:event_stage_cancelled.model_event_event
msgid "Event"
-msgstr ""
+msgstr "Evento"
#. module: event_stage_cancelled
#: model:ir.model,name:event_stage_cancelled.model_event_mail
msgid "Event Automated Mailing"
-msgstr ""
+msgstr "Invio e-mail automatiche evento"
#. module: event_stage_cancelled
#: model:ir.model,name:event_stage_cancelled.model_event_registration
msgid "Event Registration"
-msgstr ""
+msgstr "Registrazione evento"
#. module: event_stage_cancelled
#: model:ir.model,name:event_stage_cancelled.model_event_stage
msgid "Event Stage"
-msgstr ""
+msgstr "Fase evento"
#. module: event_stage_cancelled
#: model:mail.template,name:event_stage_cancelled.event_cancelled
msgid "Event: Cancelled"
-msgstr ""
+msgstr "Evento: annullato"
#. module: event_stage_cancelled
#: model:ir.model.fields,field_description:event_stage_cancelled.field_event_stage__is_cancelled
msgid "Is Cancelled"
-msgstr ""
+msgstr "È annullato"
#. module: event_stage_cancelled
#: model:ir.model,name:event_stage_cancelled.model_event_type_mail
msgid "Mail Scheduling on Event Category"
-msgstr ""
+msgstr "Schedulazione e-mail nella categoria evento"
#. module: event_stage_cancelled
#: model:ir.model,name:event_stage_cancelled.model_event_mail_registration
msgid "Registration Mail Scheduler"
-msgstr ""
+msgstr "Pianificatore e-mail di registrazione"
#. module: event_stage_cancelled
#: model:ir.model.fields,field_description:event_stage_cancelled.field_event_event__show_cancel_button
msgid "Show Cancel Button"
-msgstr ""
+msgstr "Visualizza pulsante annulla"
#. module: event_stage_cancelled
#: model:ir.model.fields,help:event_stage_cancelled.field_event_registration__cancelled_from_event
@@ -190,24 +329,27 @@ msgid ""
"from the event so we can, for example send them scheduled mails after the "
"cancellation but not if the were cancelled before that"
msgstr ""
+"Campo tecnico per distinguere le registrazioni che sono state annullate "
+"dall'evento in modo che si possa, ad esempio, inviare loro e-mail "
+"programmate dopo l'annullamento ma non se sono state annullate prima"
#. module: event_stage_cancelled
#: model:ir.model.fields,help:event_stage_cancelled.field_event_stage__is_cancelled
msgid "The event is cancelled"
-msgstr ""
+msgstr "L'evento è annullato"
#. module: event_stage_cancelled
#: model:ir.model.fields,field_description:event_stage_cancelled.field_event_type_mail__interval_type
msgid "Trigger"
-msgstr ""
+msgstr "Attivazione"
#. module: event_stage_cancelled
#: model:ir.model.fields,field_description:event_stage_cancelled.field_event_mail__interval_type
#: model:ir.model.fields,field_description:event_stage_cancelled.field_event_mail_scheduler_template__interval_type
msgid "Trigger "
-msgstr ""
+msgstr "Attivazione "
#. module: event_stage_cancelled
#: model:mail.template,subject:event_stage_cancelled.event_cancelled
msgid "{{ object.event_id.name }}: event cancelled"
-msgstr ""
+msgstr "{{ object.event_id.name }}: evento annullato"
From e01f1185dda9980f20af968c91d046eb379b4493 Mon Sep 17 00:00:00 2001
From: Bhavesh Heliconia
Date: Mon, 3 Feb 2025 15:20:58 +0530
Subject: [PATCH 8/9] [IMP] event_stage_cancelled: pre-commit auto fixes
---
.../data/mail_template_data.xml | 220 ++++++++++--------
1 file changed, 127 insertions(+), 93 deletions(-)
diff --git a/event_stage_cancelled/data/mail_template_data.xml b/event_stage_cancelled/data/mail_template_data.xml
index a5a6d1510..9fb9d16d7 100644
--- a/event_stage_cancelled/data/mail_template_data.xml
+++ b/event_stage_cancelled/data/mail_template_data.xml
@@ -11,151 +11,182 @@
name="email_to"
>{{ (object.email and '"%s" <%s>' % (object.name, object.email) or object.partner_id.email_formatted or '') }}
-
-
+
+
+
-
-
-
-
-
+
+
-
-
-
-
-
+
+
+
+
-
- Your registration
-
+ |
+ Your registration
+
+ Oscar Morgan
- |
-
-
+
+
+
View Event
-
-
-
+
+
-
- | |
-
-
+ |
+
+
+
+
- |
-
- |
-
-
-
- |
-
+ |
+
+
+
+
+
-
-
+
+
+
-
-
-
-
+
+
+ Please do not hesitate to contact the organizer at for further information:
-
- - YourCompany
-
- - Mail:
-
-
- - Phone:
-
-
-
-
-
+
+ - YourCompany
+
+ - Mail:
+
+
+ - Phone:
+
+
+
+
+
We understand the inconvenience this may cause and sincerely apologize for any disappointment.
+ />
--
- YourCompany
-
+ YourCompany
+
The OpenWood Collection Online Reveal Team
+ t-out="object.event_id.name or ''"
+ >OpenWood Collection Online Reveal Team
- |
- |
- |
-
-
-
- |
-
-|
-
+ |
+
+
+
+ |
+
+
+
+
+
- |
+ |
+
Sent by YourCompany
+ target="_blank"
+ t-attf-href="{{ object.company_id.website }}"
+ style="color: #875A7B;"
+ t-out="object.company_id.name or ''"
+ >YourCompany
Discover all our events.
- |
-
- |
- |
+
+
+
+ |
+
+
{{ object.event_id.lang or object.partner_id.lang }}
From 5cd01213da08ccbc2e1a6dfa7b82adeaa026f933 Mon Sep 17 00:00:00 2001
From: Bhavesh Heliconia
Date: Mon, 3 Feb 2025 15:22:24 +0530
Subject: [PATCH 9/9] [MIG] event_stage_cancelled: Migration to 18.0
---
event_stage_cancelled/README.rst | 14 ++-
event_stage_cancelled/__manifest__.py | 2 +-
.../data/mail_template_data.xml | 97 ++++++++++++-------
event_stage_cancelled/models/event_mail.py | 12 +++
event_stage_cancelled/readme/CONTRIBUTORS.md | 2 +
.../static/description/index.html | 10 +-
6 files changed, 92 insertions(+), 45 deletions(-)
diff --git a/event_stage_cancelled/README.rst b/event_stage_cancelled/README.rst
index 4e3c86b24..6beecce8e 100644
--- a/event_stage_cancelled/README.rst
+++ b/event_stage_cancelled/README.rst
@@ -17,13 +17,13 @@ Event cancellation workflows
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fevent-lightgray.png?logo=github
- :target: https://github.com/OCA/event/tree/17.0/event_stage_cancelled
+ :target: https://github.com/OCA/event/tree/18.0/event_stage_cancelled
:alt: OCA/event
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
- :target: https://translation.odoo-community.org/projects/event-17-0/event-17-0-event_stage_cancelled
+ :target: https://translation.odoo-community.org/projects/event-18-0/event-18-0-event_stage_cancelled
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
- :target: https://runboat.odoo-community.org/builds?repo=OCA/event&target_branch=17.0
+ :target: https://runboat.odoo-community.org/builds?repo=OCA/event&target_branch=18.0
:alt: Try me on Runboat
|badge1| |badge2| |badge3| |badge4| |badge5|
@@ -86,7 +86,7 @@ Bug Tracker
Bugs are tracked on `GitHub Issues `_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomed
-`feedback `_.
+`feedback `_.
Do not contact contributors directly about support or help with technical issues.
@@ -105,6 +105,10 @@ Contributors
- David Vidal
+- `Heliconia Solutions Pvt. Ltd. `__
+
+ - Bhavesh Heliconia
+
Maintainers
-----------
@@ -118,6 +122,6 @@ OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.
-This module is part of the `OCA/event `_ project on GitHub.
+This module is part of the `OCA/event `_ project on GitHub.
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
diff --git a/event_stage_cancelled/__manifest__.py b/event_stage_cancelled/__manifest__.py
index be5338bef..b29dae3c5 100644
--- a/event_stage_cancelled/__manifest__.py
+++ b/event_stage_cancelled/__manifest__.py
@@ -2,7 +2,7 @@
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
{
"name": "Event cancellation workflows",
- "version": "17.0.1.0.0",
+ "version": "18.0.1.0.0",
"category": "Marketing",
"author": "Tecnativa, Odoo Community Association (OCA)",
"website": "https://github.com/OCA/event",
diff --git a/event_stage_cancelled/data/mail_template_data.xml b/event_stage_cancelled/data/mail_template_data.xml
index 9fb9d16d7..391ac13d5 100644
--- a/event_stage_cancelled/data/mail_template_data.xml
+++ b/event_stage_cancelled/data/mail_template_data.xml
@@ -6,10 +6,13 @@
{{ object.event_id.name }}: event cancelled
{{ (object.event_id.organizer_id.email_formatted or object.event_id.user_id.email_formatted or '') }}
+ >{{ (object.event_id.organizer_id.email_formatted or object.event_id.user_id.email_formatted or '') }}
+
{{ (object.email and '"%s" <%s>' % (object.name, object.email) or object.partner_id.email_formatted or '') }}
+ >{{ (object.email and '"%s" <%s>' % (object.name, object.email) or object.partner_id.email_formatted or
+ '') }}
+
Oscar Morgan
+ >Oscar Morgan
+
@@ -71,8 +75,8 @@
t-attf-href="{{ object.event_id.website_url }}"
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"
>
- View Event
-
+ View Event
+
- Hello Oscar Morgan,
- We are sorry to inform you that the
-
+ Hello Oscar Morgan,
+
+ We are sorry to inform you that the
+
OpenWood Collection Online Reveal
+ >OpenWood Collection Online Reveal
+
-
+
OpenWood Collection Online Reveal
+ >OpenWood Collection Online Reveal
+
- has been cancelled.
-
+ has been cancelled.
+
Please do not hesitate to contact the organizer at for further information:
+ >Please do not hesitate to contact the organizer at for
+ further information:
+
- Phone: Phone:
+
+ />
+
- We understand the inconvenience this may cause and sincerely apologize for any disappointment.
-
- --
-
+ We understand the inconvenience this may cause and sincerely
+ apologize for any disappointment.
+
+
+ --
+
+
YourCompany
-
- The
+ The OpenWood Collection Online Reveal Team
-
-
-
+ >OpenWood Collection Online Reveal
+ Team
+
+
+
|
@@ -196,17 +214,24 @@
>
- Sent by YourCompany
-
-
- Discover all our events.
-
- |
+ >YourCompany
+
+
+
+ Discover all our events.
+
+
diff --git a/event_stage_cancelled/models/event_mail.py b/event_stage_cancelled/models/event_mail.py
index 1a2e9ac7f..0a2ffdc3d 100644
--- a/event_stage_cancelled/models/event_mail.py
+++ b/event_stage_cancelled/models/event_mail.py
@@ -31,6 +31,18 @@ def _compute_scheduled_date(self):
)
return res
+ @api.depends("interval_type", "mail_done", "scheduled_date")
+ def _compute_mail_state(self):
+ todo = self.filtered(lambda x: x.interval_type == "after_cancel")
+ for scheduler in todo:
+ if scheduler.mail_done:
+ scheduler.mail_state = "sent"
+ elif scheduler.scheduled_date:
+ scheduler.mail_state = "scheduled"
+ else:
+ scheduler.mail_state = "running"
+ return super(EventMail, self - todo)._compute_mail_state()
+
def execute(self):
"""Plan the mailings"""
regular_schedulers = self.filtered(lambda x: x.interval_type != "after_cancel")
diff --git a/event_stage_cancelled/readme/CONTRIBUTORS.md b/event_stage_cancelled/readme/CONTRIBUTORS.md
index 3a16ddf04..56be09222 100644
--- a/event_stage_cancelled/readme/CONTRIBUTORS.md
+++ b/event_stage_cancelled/readme/CONTRIBUTORS.md
@@ -1,2 +1,4 @@
- [Tecnativa](https://tecnativa.com)
- David Vidal
+- [Heliconia Solutions Pvt. Ltd.](https://www.heliconia.io)
+ - Bhavesh Heliconia
diff --git a/event_stage_cancelled/static/description/index.html b/event_stage_cancelled/static/description/index.html
index ad71cfe49..18d47500c 100644
--- a/event_stage_cancelled/static/description/index.html
+++ b/event_stage_cancelled/static/description/index.html
@@ -369,7 +369,7 @@ Event cancellation workflows
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:215ccf9ff3805b28dd2784676cd51483becf64b645161e4d37fbcd93f2cfbccf
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
-

+

This module adds the posibility of flagging an event stage as cancelled
so we can hook workflows onto it like cancelling registrations or
scheduling special mail events.
@@ -434,7 +434,7 @@
Bugs are tracked on GitHub Issues.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomed
-feedback.
+feedback.
Do not contact contributors directly about support or help with technical issues.
@@ -463,7 +467,7 @@
OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.
-
This module is part of the OCA/event project on GitHub.
+
This module is part of the OCA/event project on GitHub.
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.