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

Module: Time Off

Entity: hr.leave.allocation

Compute Method: _compute_can_approve

View 17.0 View 18.0
Inputs Method Outputs
  • state
  • validation_type
for allocation in self:
            try:
-                 if allocation.state == 'confirm' and allocation.validation_type != 'no':
+                 if allocation.state == 'confirm' and allocation.validation_type == 'both':
+                     allocation._check_approval_update('validate1')
+                 else:
                    allocation._check_approval_update('validate')
            except (AccessError, UserError):
                allocation.can_approve = False
            else:
                allocation.can_approve = True
  • can_approve

Back to entity