diff --git a/odex25_hr/hr_holidays_public/models/hr_holidays.py b/odex25_hr/hr_holidays_public/models/hr_holidays.py index b3cce984f..3b1a970c5 100644 --- a/odex25_hr/hr_holidays_public/models/hr_holidays.py +++ b/odex25_hr/hr_holidays_public/models/hr_holidays.py @@ -1817,15 +1817,15 @@ class HRHolidays(models.Model): user = self.env.user # Check if user is **NOT** in the HR group - if not user.has_group("hr.group_hr_user"): - if date_to_value < date_from_value: - raise exceptions.Warning(_('Sorry, Date TO must be later than Date FROM')) + # self.env.user.has_group( + if date_to_value < date_from_value: + raise exceptions.Warning(_('Sorry Date TO must be bigger than Date From')) + + if not self.env.user.has_group("hr.group_hr_user"): if (date_from_value - current_date).days + 1 < item.holiday_status_id.request_before: - raise exceptions.Warning( - _('Sorry, your leave request must be submitted at least %s days in advance.') - % item.holiday_status_id.request_before - ) + raise exceptions.Warning(_('Sorry your request must be before %s Days of your leave') \ + % item.holiday_status_id.request_before) # if date_to_value < date_from_value: # raise exceptions.Warning(_('Sorry Date TO must be bigger than Date From'))