Merge pull request #3409 from expsa/hr_change_title

modify on fields and report
This commit is contained in:
eslamtalaat744 2025-06-03 10:33:05 +03:00 committed by GitHub
commit d9d9c5fc19
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 7 additions and 7 deletions

View File

@ -1817,15 +1817,15 @@ class HRHolidays(models.Model):
user = self.env.user user = self.env.user
# Check if user is **NOT** in the HR group # Check if user is **NOT** in the HR group
if not user.has_group("hr.group_hr_user"): # self.env.user.has_group(
if date_to_value < date_from_value:
raise exceptions.Warning(_('Sorry, Date TO must be later than Date FROM'))
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: if (date_from_value - current_date).days + 1 < item.holiday_status_id.request_before:
raise exceptions.Warning( raise exceptions.Warning(_('Sorry your request must be before %s Days of your leave') \
_('Sorry, your leave request must be submitted at least %s days in advance.') % item.holiday_status_id.request_before)
% item.holiday_status_id.request_before
)
# if date_to_value < date_from_value: # if date_to_value < date_from_value:
# raise exceptions.Warning(_('Sorry Date TO must be bigger than Date From')) # raise exceptions.Warning(_('Sorry Date TO must be bigger than Date From'))