diff --git a/addons/hr_holidays/models/hr_leave_allocation.py b/addons/hr_holidays/models/hr_leave_allocation.py index 4710052e9ec..3ae013f1c1a 100644 --- a/addons/hr_holidays/models/hr_leave_allocation.py +++ b/addons/hr_holidays/models/hr_leave_allocation.py @@ -575,7 +575,7 @@ class HolidaysAllocation(models.Model): return holidays def write(self, values): - if not bool(values.get('active', True)): + if not self.env.context.get('toggle_active') and not bool(values.get('active', True)): if any(allocation.state not in ['draft', 'cancel', 'refuse'] for allocation in self): raise UserError(_('You cannot archive an allocation which is in confirm or validate state.')) employee_id = values.get('employee_id', False)