Skip to content

Commit

Permalink
[IMP] Prevent sending confirmation mails to contact without email
Browse files Browse the repository at this point in the history
  • Loading branch information
BT-dmoreno committed Aug 31, 2023
1 parent c69021d commit 963559c
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 1 deletion.
1 change: 1 addition & 0 deletions pos_event_sale/models/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from . import event_event
from . import event_mail
from . import event_registration
from . import event_ticket
from . import pos_order
Expand Down
20 changes: 20 additions & 0 deletions pos_event_sale/models/event_mail.py
Original file line number Diff line number Diff line change
@@ -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'))
3 changes: 2 additions & 1 deletion pos_event_sale/models/pos_session.py
Original file line number Diff line number Diff line change
@@ -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

Expand Down
4 changes: 4 additions & 0 deletions pos_event_sale/static/src/scss/pos_event_sale.scss
Original file line number Diff line number Diff line change
Expand Up @@ -481,4 +481,8 @@ $pos-event-sale-primary-color: #6ec89b !default;
}
}
}

div.button.next.validation {
cursor: pointer;
}
}

0 comments on commit 963559c

Please sign in to comment.