[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
This commit is contained in:
Lucas Perais (lpe)
2016-12-08 08:50:27 +01:00
parent 6665526ccc
commit 85160f8da2
+1 -1
View File
@@ -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