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
  • unit_amount
  • date_time
  • product_uom_id
  • product_uom_id.related_uom_ids
  • company_id
  • company_id.project_time_mode_id
uom_ref = self.env.ref("uom.product_uom_hour")
for record in self:
            if (
                record.unit_amount
                and record.date_time
                and uom_ref
                in (
                    record.product_uom_id.related_uom_ids | record.product_uom_id
                    or record.company_id.project_time_mode_id
                )
            ):
                record.date_time_end = record.date_time + relativedelta(
                    hours=record.unit_amount
                    * (
                        record.product_uom_id or record.company_id.project_time_mode_id
                    ).factor
                )
            else:
                record.date_time_end = False

Back to entity