Odoo Mindscape. Understand Odoo faster. Explore modules, fields, dependencies and version differences in one place instead of digging through the source code.
Module: Job Queue
Entity: queue.job
Compute Method: _compute_graph_jobs_count
| Inputs | Method | Outputs |
|---|---|---|
|
- jobs_groups = self.env["queue.job"].read_group( - [ - ( - "graph_uuid", - "in", - [uuid for uuid in self.mapped("graph_uuid") if uuid], + graph_uuids = [uuid for uuid in self.mapped("graph_uuid") if uuid] + if graph_uuids: + count_per_graph_uuid = dict( + self.env["queue.job"]._read_group( + [("graph_uuid", "in", graph_uuids)], + groupby=["graph_uuid"], + aggregates=["__count"], ) - ], - ["graph_uuid"], - ["graph_uuid"], - ) - count_per_graph_uuid = { - group["graph_uuid"]: group["graph_uuid_count"] for group in jobs_groups - } + ) + else: + count_per_graph_uuid = {} for record in self: record.graph_jobs_count = count_per_graph_uuid.get(record.graph_uuid) or 0 |
|
