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

Module: Project

Entity: account.analytic.account

Compute Method: _compute_project_count

View 17.0 View 20.0
Inputs Method Outputs
  • id
- project_data = self.env['project.project']._read_group([('analytic_account_id', 'in', self.ids)], ['analytic_account_id'], ['__count'])
+ project_data = self.env['project.project']._read_group([('account_id', 'in', self.ids)], ['account_id'], ['__count'])
mapping = {analytic_account.id: count for analytic_account, count in project_data}
for account in self:
            account.project_count = mapping.get(account.id, 0)
  • project_count

Back to entity