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

Module: API Log

Entity: api.log_collection.mixin

Compute Method: _compute_log_ids

View 18.0
Inputs Method Outputs
  • id
- all_logs = self.env["api.log"].search_read(
-             domain=self._get_logs_domain(),
-             fields=[
-                 "collection_id",
-             ],
-             load=None,
-         )
- log_ids_by_collection_id = {}
- for log in all_logs:
-             log_ids_by_collection_id.setdefault(log["collection_id"], []).append(
-                 log["id"]
-             )
- for collection in self:
-             collection.log_ids = log_ids_by_collection_id.get(collection.id)
  • log_ids

Back to entity