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_payment_lot_count

Inputs Method Outputs
  • id
rg_res = self.env["account.payment.lot"]._read_group(
            [("order_id", "in", self.ids)], groupby=["order_id"], aggregates=["__count"]
        )
mapped_data = {order.id: count for (order, count) in rg_res}
for order in self:
            order.payment_lot_count = mapped_data.get(order.id, 0)

Back to entity