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
rg_res = self.env["account.move"].read_group(
            [("payment_order_id", "in", self.ids)],
            ["payment_order_id"],
            ["payment_order_id"],
        )
mapped_data = {
            x["payment_order_id"][0]: x["payment_order_id_count"] for x in rg_res
        }
for order in self:
            order.move_count = mapped_data.get(order.id, 0)

Back to entity