From 5c9b6dd702972b04c5592ebafc3cd6177e630865 Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Tue, 23 Jan 2018 17:05:40 +0100 Subject: [PATCH] FIX to make it work with lunch voucher on months when nobody took holidays --- hr_holidays_usability/wizard/hr_holidays_to_payslip.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/hr_holidays_usability/wizard/hr_holidays_to_payslip.py b/hr_holidays_usability/wizard/hr_holidays_to_payslip.py index 1b7ef77..da911dc 100644 --- a/hr_holidays_usability/wizard/hr_holidays_to_payslip.py +++ b/hr_holidays_usability/wizard/hr_holidays_to_payslip.py @@ -57,8 +57,10 @@ class HrHolidaysToPayslip(models.TransientModel): # because, after the write, it doesn't have a value any more !!! holidays_to_payslip = self.holidays_to_payslip_ids today = fields.Date.context_today(self) - if not self.holidays_to_payslip_ids: - raise UserError(_('No leave request to transfer to payslip.')) + # 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_payslip_ids: + # raise UserError(_('No leave request to transfer to payslip.')) self.holidays_to_payslip_ids.write({'payslip_date': today}) view_id = self.env.ref('hr_holidays_usability.hr_holiday_pivot').id action = {