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: sale.order.line

Compute Method: _compute_remaining_hours_available

Inputs Method Outputs
  • product_id
  • product_id.service_policy
  • product_uom_id
for line in self:
            is_ordered_prepaid = line.product_id.service_policy == 'ordered_prepaid'
            is_time_product = line.product_uom_id and line.product_uom_id._has_common_reference(self.env.ref('uom.product_uom_hour'))
            line.remaining_hours_available = is_ordered_prepaid and is_time_product

Back to entity