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

Module: Payment Engine

Entity: payment.transaction

Compute Method: _compute_payment_data_count

Inputs Method Outputs
  • id
rg_data = self.env["payment.data"]._read_group(
            domain=[("transaction_id", "in", self.ids)],
            groupby=["transaction_id"],
            aggregates=["__count"],
        )
data = {transaction.id: count for transaction, count in rg_data}
for record in self:
            record.payment_data_count = data.get(record.id, 0)

Back to entity