When I try to validate a Timesheet, I get the message « Please add an employee’s public holiday events planning related to user X » where X is the name of the user.
You can actually see this message pop up in one of the Axelor demonstration videos after the 2 minute mark.
I logged in as an Admin. I created a timesheet. My user is their own HR Manager. I tried to validate it and the message appeared.
I can’t find any solution for this problem - I don’t see any option anywhere for adding « Employee’s Public Holiday Events Planning. »
I’ve added public holidays to the company, and configured HR etc. My user is an Admin, and an HR Manager, and I still can’t validate my timesheets.
Here’s the stack trace;
com.axelor.apps.base.AxelorException: Please add an employee’s public holiday events planning related to user P1506 - W Linda
at com.axelor.apps.hr.service.timesheet.TimesheetLineGenerationServiceImpl.checkEmptyPeriod(TimesheetLineGenerationServiceImpl.java:155)
at com.axelor.apps.hr.service.timesheet.TimesheetWorkflowCheckServiceImpl.validateCheck(TimesheetWorkflowCheckServiceImpl.java:66)
at com.axelor.apps.hr.service.timesheet.TimesheetWorkflowServiceImpl.validate(TimesheetWorkflowServiceImpl.java:104)
at com.axelor.apps.businessproduction.service.TimesheetBusinessProductionWorkflowServiceImpl.validate(TimesheetBusinessProductionWorkflowServiceImpl.java:67)
at com.google.inject.persist.jpa.JpaLocalTxnInterceptor.invoke(JpaLocalTxnInterceptor.java:56)
at com.axelor.apps.hr.service.timesheet.TimesheetWorkflowServiceImpl.validateAndSendValidationEmail(TimesheetWorkflowServiceImpl.java:137)
at com.google.inject.persist.jpa.JpaLocalTxnInterceptor.invoke(JpaLocalTxnInterceptor.java:64)
at com.axelor.apps.hr.service.timesheet.TimesheetWorkflowServiceImpl.complete(TimesheetWorkflowServiceImpl.java:318)
at com.axelor.apps.hr.web.timesheet.TimesheetController.complete(TimesheetController.java:480)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
Looking in the code, in order…
public void checkEmptyPeriod(Timesheet timesheet) throws AxelorException {
Employee employee = timesheet.getEmployee(); if (employee == null) { return; } if (employee.getPublicHolidayEventsPlanning() == null) { throw new AxelorException( timesheet, TraceBackRepository.CATEGORY_CONFIGURATION_ERROR, I18n.get(HumanResourceExceptionMessage.TIMESHEET_EMPLOYEE_PUBLIC_HOLIDAY_EVENTS_PLANNING), employee.getName()); }
The Employee’s « publicHolidayEventsPlanning » object is null, so an exception is being thrown. This is the source of the message;
// From HumanResourceExceptionMessage.java
public static final String TIMESHEET_EMPLOYEE_PUBLIC_HOLIDAY_EVENTS_PLANNING = /$$(/
« Please add an employee’s public holiday events planning related to user %s » /)/;
The com.axelor.apps.base.db.EventsPlanning object is not set in the hr_employee record. It looks like it needs a valid EventsPlanning (base_events_planning) object.
How do you set the Employee’s EventsPlanning record so that the validation process passes?
Thank you for your help in advance!