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

Module: Endpoint cache

Entity: endpoint.mixin

Compute Method: _compute_cache_att_count

View 18.0
Inputs Method Outputs
  • id
+ domain = [
+             ("name", "like", "endpoint_cache%"),
+             ("res_model", "=", self._name),
+         ]
+ data = self.env["ir.attachment"].read_group(domain, ["res_id"], ["res_id"])
+ mapped_data = {m["res_id"]: m["res_id_count"] for m in data}
+ for rec in self:
+             rec.cache_att_count = mapped_data.get(rec.id, 0)
  • cache_att_count

Back to entity