Odoo Mindscape. Understand Odoo faster. Explore modules, fields, dependencies and version differences in one place instead of digging through the source code.

Module: Event Sessions

Entity: event.session

Compute Method: _compute_event_registrations_open

View 18.0
Inputs Method Outputs
  • event_registrations_started
  • date_end
  • seats_limited
  • seats_max
  • seats_available
  • event_ticket_ids
- """Similar to core's :meth:`event_event._compute_event_registrations_open`"""
- now = fields.Datetime.now()
- for rec in self:
-             rec.event_registrations_open = (
-                 rec.event_registrations_started
-                 and (not rec.date_end or rec.date_end >= now)
-                 and (not rec.seats_limited or not rec.seats_max or rec.seats_available)
-                 and (
-                     not rec.event_ticket_ids
-                     or any(ticket.sale_available for ticket in rec.event_ticket_ids)
-                 )
-             )
  • event_registrations_open

Back to entity