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
| Inputs | Method | Outputs |
|---|---|---|
|
- 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) |
|
