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

Module: Project timesheet time control

Entity: account.analytic.line

Compute Method: _compute_date_time_end

Inputs Method Outputs
hour_uom = self.env.ref("uom.product_uom_hour")
for record in self:
            if (
                record.product_uom_id == hour_uom
                and record.date_time
                and record.unit_amount
            ):
                record.date_time_end = record.date_time + relativedelta(
                    hours=record.unit_amount
                )
            else:
                record.date_time_end = record.date_time_end

Back to entity