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

Module: POS - Event

Entity: event.event

Compute Method: _compute_pos_price_total

View 20.0
Inputs Method Outputs
  • company_id
  • id
  • currency_id
+ """ Compute the total amount (tax included) of paid/posted PoS orders linked to the event. """
+ totals = {event.id: 0.0 for event in self}
+ event_subtotals = self.env['pos.order.line']._read_group(
+             [('event_ticket_id.event_id', 'in', self.ids), ('order_id.state', 'in', ['paid', 'done'])],
+             ['event_ticket_id.event_id', 'currency_id'],
+             ['price_subtotal_incl:sum'],
+         )
+ for event, currency_id, sum_subtotal in event_subtotals:
+             company = event.company_id or self.env.company
+             totals[event.id] += event.currency_id._convert(sum_subtotal, currency_id, company)
+ for event in self:
+             event.pos_price_total = totals.get(event.id, 0.0)
  • pos_price_total

Back to entity