-
Notifications
You must be signed in to change notification settings - Fork 716
Open
Description
In axelor-human-resource/src/main/resources/views/LeaveRequest.xml there is this snippet:
<action-attrs name="action-leave-request-attrs-leave-reason-domain">
<attribute name="domain" for="leaveReason"
expr="eval: "self.leaveReasonTypeSelect = 2""/>
<attribute name="domain" for="leaveReason"
expr="eval: "self.leaveReasonTypeSelect = 2 OR self IN (SELECT leaveReason FROM LeaveLine leaveLine WHERE leaveLine.employee.id = ${__this__.employee.id})""
if="employee != null"/>
<attribute name="domain" for="leaveReason"
expr="eval: "(self.leaveReasonTypeSelect = 2 OR self IN (SELECT leaveReason FROM LeaveLine leaveLine WHERE leaveLine.employee.id = ${__this__.employee.id})) AND (self.selectedByMgtOnly = false) ""
if="employee != null && !__user__.employee?.hrManager"/>
</action-attrs>
If the user is an HR Manager, then the third attribute will fall away. Thus self.selectedByMgtOnly is never considered, because the first two attributes don't contain it.
I am guessing that the intent is for an HR Manager to be able to select leave reasons where self.selectedByMgtOnly is true, but this won't happen.
I don't see any automated tests for this logic. If there are, please point me to them.
There might be a bug in the logic here or maybe I just don't understand it. If my understanding is wrong, please explain the intent to me.
Thanks,
Evert
Metadata
Metadata
Assignees
Labels
No labels