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

Module: Sales Timesheet

Entity: account.move

Compute Method: _compute_timesheet_count

Inputs Method Outputs
timesheet_data = self.env['account.analytic.line']._read_group(
            [
                ('reinvoice_move_id', 'in', self.ids),
                ('project_id', '!=', False),
            ],
            ['reinvoice_move_id'],
            ['__count'],
        )
mapped_data = dict(timesheet_data)
for invoice in self:
            invoice.timesheet_count = mapped_data.get(invoice, 0)

Back to entity