From a22877068ebb38164239a2a528c76cdcb71d513b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=B9=8F=E5=AE=87?= Date: Mon, 29 Jun 2026 17:43:11 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A2=81=E6=A1=82=E6=B7=BB=E8=AF=B7=E5=81=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- yuthon_holiday/models/inherit_hr_leave.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/yuthon_holiday/models/inherit_hr_leave.py b/yuthon_holiday/models/inherit_hr_leave.py index 3b887d193..b93404517 100644 --- a/yuthon_holiday/models/inherit_hr_leave.py +++ b/yuthon_holiday/models/inherit_hr_leave.py @@ -18,6 +18,9 @@ class HrLeave(models.Model): _inherit = 'hr.leave' number_of_days = fields.Float(string='天数', digits=(16, 3)) + def _get_leaves_on_public_holiday(self): + """覆盖原生方法,跳过'员工不应在期间工作(周末/节假日)'的拦截校验""" + return self.env['hr.leave'] # 返回空记录集,不拦截任何请假单 def _check_validity(self): sorted_leaves = defaultdict(lambda: self.env['hr.leave'])