Skip to content

Commit

Permalink
[IMP] event_sale_registration_multi_qty: Compatibility with event_sal…
Browse files Browse the repository at this point in the history
…e_reservation addon.

TT31321
  • Loading branch information
victoralmau committed Jan 26, 2022
1 parent 27d778c commit 7fb5c00
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
6 changes: 6 additions & 0 deletions event_sale_registration_multi_qty/models/sale_order.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@ def _update_registrations(
self, confirm=True, cancel_to_draft=False, registration_data=None
):
"""Update registrations on events with multi qty enabled"""
if self.env.context.get("skip_event_sale_registration_multi_qty"):
return super()._update_registrations(
confirm=confirm,
cancel_to_draft=cancel_to_draft,
registration_data=registration_data,
)
Registration = self.env["event.registration"]
for so_line in self.filtered("event_id"):
if not so_line.event_id.registration_multi_qty:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ class RegistrationEditor(models.TransientModel):
@api.model
def default_get(self, fields):
res = super().default_get(fields)
if self.env.context.get("skip_event_sale_registration_multi_qty"):
return res
Event = self.env["event.event"]
SaleOrderLine = self.env["sale.order.line"]
attendees = [(6, 0, [])]
Expand Down

0 comments on commit 7fb5c00

Please sign in to comment.