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

Module: Account Payment Batch OCA

Entity: account.payment.order

Compute Method: _compute_total

Inputs Method Outputs
  • id
rg_res = self.env["account.payment.line"]._read_group(
            [("order_id", "in", self.ids)],
            groupby=["order_id"],
            aggregates=["amount_company_currency:sum"],
        )
mapped_data = {order.id: total for (order, total) in rg_res}
for order in self:
            order.total_company_currency = mapped_data.get(order.id, 0)

Back to entity