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

Module: Indonesia E-faktur

Entity: account.move

Compute Method: _compute_available_range_count

Inputs Method Outputs
id_moves = self.filtered(lambda x: x.country_code == 'ID')
other_moves = self - id_moves
if other_moves:
            other_moves.l10n_id_available_range_count = 0
if id_moves:
            range_count_per_company = dict(
                self.env['l10n_id_efaktur.efaktur.range']._read_group(
                    [('available', '>', 0), ('company_id', 'in', id_moves.company_id.ids)],
                    ['company_id'],
                    ['__count']
                )
            )
            for company_id, moves in id_moves.grouped('company_id').items():
                moves.l10n_id_available_range_count = range_count_per_company.get(company_id, 0)

Back to entity