From 85160f8da2b2097ab9dfee8909bd4977eb133a2d Mon Sep 17 00:00:00 2001 From: "Lucas Perais (lpe)" Date: Mon, 5 Dec 2016 14:35:27 +0100 Subject: [PATCH] [FIX] hr_holidays: This commit corrects the behavior of holidays validation When allocating holidays to an empty tag (or category), double validation doesn't crash anymore, though it does nothing Closes #14591 OPW #694748 --- addons/hr_holidays/models/hr_holidays.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/hr_holidays/models/hr_holidays.py b/addons/hr_holidays/models/hr_holidays.py index a9b45c1aec0..c21e691bf40 100644 --- a/addons/hr_holidays/models/hr_holidays.py +++ b/addons/hr_holidays/models/hr_holidays.py @@ -504,7 +504,7 @@ class Holidays(models.Model): leaves += self.with_context(mail_notify_force_send=False).create(values) # TODO is it necessary to interleave the calls? leaves.action_approve() - if leaves[0].double_validation: + if leaves and leaves[0].double_validation: leaves.action_validate() return True