From 963559c13b6882a9bffc08391a1225c9dda07f29 Mon Sep 17 00:00:00 2001 From: David Moreno Date: Thu, 31 Aug 2023 11:24:53 +0200 Subject: [PATCH] [IMP] Prevent sending confirmation mails to contact without email --- pos_event_sale/models/__init__.py | 1 + pos_event_sale/models/event_mail.py | 20 +++++++++++++++++++ pos_event_sale/models/pos_session.py | 3 ++- .../static/src/scss/pos_event_sale.scss | 4 ++++ 4 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 pos_event_sale/models/event_mail.py diff --git a/pos_event_sale/models/__init__.py b/pos_event_sale/models/__init__.py index 967741d6bd..1212a0ef85 100644 --- a/pos_event_sale/models/__init__.py +++ b/pos_event_sale/models/__init__.py @@ -1,4 +1,5 @@ from . import event_event +from . import event_mail from . import event_registration from . import event_ticket from . import pos_order diff --git a/pos_event_sale/models/event_mail.py b/pos_event_sale/models/event_mail.py new file mode 100644 index 0000000000..c3ec7f2d71 --- /dev/null +++ b/pos_event_sale/models/event_mail.py @@ -0,0 +1,20 @@ +############################################################################## +# Copyright (c) 2023 braintec AG (https://braintec.com) +# All Rights Reserved +# +# Licensed under the AGPL-3.0 (http://www.gnu.org/licenses/agpl.html) +# See LICENSE file for full licensing details. +############################################################################## + +from odoo import models + + +class EventMail(models.Model): + _inherit = "event.mail" + + def _create_missing_mail_registrations(self, registrations): + """Create mail registrations just for those partners with email. + + This way we also prevent long delays in the POS, at the time of the order validation. + """ + return super()._create_missing_mail_registrations(registrations.filtered('email')) diff --git a/pos_event_sale/models/pos_session.py b/pos_event_sale/models/pos_session.py index 1fb7a85600..cb084aa0f1 100644 --- a/pos_event_sale/models/pos_session.py +++ b/pos_event_sale/models/pos_session.py @@ -1,10 +1,11 @@ ############################################################################## -# Copyright (c) 2023 brain-tec AG (https://braintec.com) +# Copyright (c) 2023 braintec AG (https://braintec.com) # All Rights Reserved # # Licensed under the AGPL-3.0 (http://www.gnu.org/licenses/agpl.html). # See LICENSE file for full licensing details. ############################################################################## + from odoo import api, fields, models from odoo.tools import date_utils diff --git a/pos_event_sale/static/src/scss/pos_event_sale.scss b/pos_event_sale/static/src/scss/pos_event_sale.scss index 9ccc521b30..7f6076b2bf 100644 --- a/pos_event_sale/static/src/scss/pos_event_sale.scss +++ b/pos_event_sale/static/src/scss/pos_event_sale.scss @@ -481,4 +481,8 @@ $pos-event-sale-primary-color: #6ec89b !default; } } } + + div.button.next.validation { + cursor: pointer; + } }