[MIG]allow_negative_leave_and_allocation:v14

This commit is contained in:
2025-01-02 14:23:16 +01:00
parent 141ad6bfcd
commit 87dd45a49f
13 changed files with 958 additions and 0 deletions

View File

@@ -0,0 +1,16 @@
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
# Copyright (c) 2005-2006 Axelor SARL. (http://www.axelor.com)
from odoo import api, models
class HrLeave(models.Model):
_inherit = "hr.leave"
@api.constrains("state", "number_of_days", "holiday_status_id")
def _check_holidays(self):
for holiday in self:
if holiday.holiday_status_id.allows_negative:
continue
super()._check_holidays()