How to automatically increase the total annual leave duration if employees applies for compensatory days in time off module odoov15
please help me to solve this.
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
How to automatically increase the total annual leave duration if employees applies for compensatory days in time off module odoov15
please help me to solve this.
Create an account today to enjoy exclusive features and engage with our awesome community!
Sign up
1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.
please help me to solve this..
def alloc_leaves(self):
alloc_obj = self.env['hr.leave.allocation']
for al in self:
if al.iwave_auto_allocation is True:
if al.holiday_status_id.name is 'Holiday Work Request':
for emp in al.employee_ids:
vals = {
'name': 'Personal/Sick Leave ' + emp.name,
'holiday_status_id': al.leave_type_id.id,
'holiday_type': 'employee',
'employee_id': emp.id,
}
if al.request_unit == 'days':
vals.update({'number_of_days': al.number_of_days})
alloc = alloc_obj.create(vals)
alloc.action_approve()