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 Order

Entity: account.payment.order

Compute Method: _compute_move_count

Inputs Method Outputs
  • id
data = self.env["account.move"]._read_group(
            [("payment_order_id", "in", self.ids)], ["payment_order_id"], ["__count"]
        )
count_data = {payment_order.id: count for payment_order, count in data}
for order in self:
            order.move_count = count_data.get(order.id) or 0

Back to entity