[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:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user