2 fixes in hr_holidays modules

This commit is contained in:
Alexis de Lattre
2017-09-22 15:57:16 +02:00
parent 1160cce1d8
commit 44b32672e2
2 changed files with 17 additions and 4 deletions

View File

@@ -74,9 +74,11 @@ class HrHolidaysPost(models.TransientModel):
# because, after the write, it doesn't have a value any more !!!
holidays_to_post = self.holidays_to_post_ids
today = fields.Date.context_today(self)
if not self.holidays_to_post_ids:
raise Warning(
_('No leave request to post.'))
# Disable the raise below to make the module "hr_holidays_lunch_voucher"
# work even when nobody took holidays on the current month
# if not self.holidays_to_post_ids:
# raise Warning(
# _('No leave request to post.'))
self.holidays_to_post_ids.write({'posted_date': today})
view_id = self.env.ref('hr_holidays_usability.hr_holiday_graph').id
action = {