Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
3e9fee7
fix: default permission for HR User role
iamkhanraheel Mar 24, 2026
c6e46fc
fix: default permission for HR manager role & add custom docperm for …
iamkhanraheel Mar 26, 2026
0873f41
Merge branch 'develop' into fix/default_role_permission
iamkhanraheel Mar 26, 2026
5542ee6
Merge branch 'develop' into fix/default_role_permission
iamkhanraheel Apr 7, 2026
4a8fff8
fix: default perm for HR manager & HR user
iamkhanraheel Apr 7, 2026
4ad1dec
fix: deault perm for HR manager & HR user
iamkhanraheel Apr 9, 2026
3e8274a
fix: remove unwanted import
iamkhanraheel Apr 9, 2026
37158b6
fix: add update_permission_property to update perm in existing custom…
iamkhanraheel Apr 9, 2026
739fdfb
patch: add default HR roles permissions
iamkhanraheel Apr 10, 2026
b83b9e3
fix(pwa): approval actions button for self leaves
iamkhanraheel Apr 15, 2026
e556cfa
Merge branch 'develop' into fix/default_role_permission
iamkhanraheel Apr 16, 2026
44ca81e
fix: add default perms for HR user & remove unnecessary perms
iamkhanraheel Apr 16, 2026
af99a2f
test(expense_claim): add repost doctype in repost_allowed_types as Re…
iamkhanraheel Apr 16, 2026
a712930
fix: remove unnecessary access for manufacturing & account user roles
iamkhanraheel Apr 16, 2026
4a25b9a
Merge branch 'develop' into fix/default_role_permission
iamkhanraheel Apr 16, 2026
0fae64e
fix(pwa): add validation in hasPermission to prevent actions on self …
iamkhanraheel Apr 16, 2026
e4dee64
style: remove extra spaces
iamkhanraheel Apr 16, 2026
630332f
Merge branch 'develop' into fix/approval_actions_for_self_leave
deepeshgarg007 Apr 16, 2026
f0dc76b
Merge branch 'develop' into fix/default_role_permission
deepeshgarg007 Apr 17, 2026
4548be3
Merge pull request #4264 from iamkhanraheel/fix/default_role_permission
deepeshgarg007 Apr 17, 2026
b4fb23e
Merge branch 'develop' into fix/approval_actions_for_self_leave
deepeshgarg007 Apr 17, 2026
84ffdc4
Merge pull request #4395 from iamkhanraheel/fix/approval_actions_for_…
deepeshgarg007 Apr 17, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions frontend/src/components/CheckInPanel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,12 @@
</template>

<script setup>
import { createResource, createListResource, toast, FeatherIcon } from "frappe-ui"
import { createListResource, toast, FeatherIcon } from "frappe-ui"
import { computed, inject, ref, onMounted, onBeforeUnmount } from "vue"
import { IonModal, modalController } from "@ionic/vue"

import { formatTimestamp } from "@/utils/formatters"
import { settings } from "@/data/settings"

const DOCTYPE = "Employee Checkin"

Expand All @@ -93,10 +94,6 @@ const checkinTimestamp = ref(null)
const latitude = ref(0)
const longitude = ref(0)
const locationStatus = ref("")
const settings = createResource({
url: "hrms.api.get_hr_settings",
auto: true,
})

const checkins = createListResource({
doctype: DOCTYPE,
Expand Down
11 changes: 10 additions & 1 deletion frontend/src/components/RequestActionSheet.vue
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ import FilePreviewModal from "@/components/FilePreviewModal.vue"
import WorkflowActionSheet from "@/components/WorkflowActionSheet.vue"

import { getCompanyCurrency } from "@/data/currencies"
import { settings } from "@/data/settings"
import { formatCurrency } from "@/utils/formatters"

import useWorkflow from "@/composables/workflow"
Expand Down Expand Up @@ -231,9 +232,16 @@ const permittedWriteFields = createResource({
auto: true,
})

const sessionEmployee = inject("$employee")

function hasPermission(action) {
if (action === "approval")
if (action === "approval" && props.modelValue.doctype === "Leave Application"){
// prevent self leave approval
const isSelfLeave = document?.doc?.employee === sessionEmployee?.data?.name
if (isSelfLeave && settings.data?.prevent_self_leave_approval)
return false
return permittedWriteFields.data?.includes(approvalField.value)
}
return docPermissions.data?.permissions[action]
}

Expand Down Expand Up @@ -337,6 +345,7 @@ const openFormView = () => {
onMounted(() => {
workflow.value = useWorkflow(props.modelValue.doctype)
})

</script>

<style scoped>
Expand Down
5 changes: 4 additions & 1 deletion frontend/src/components/RequestList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,10 @@
:initial-breakpoint="1"
:breakpoints="[0, 1]"
>
<RequestActionSheet :fields="fieldsMap[selectedRequest?.doctype]" v-model="selectedRequest" />
<RequestActionSheet
:fields="fieldsMap[selectedRequest?.doctype]"
v-model="selectedRequest"
/>
</ion-modal>
</template>

Expand Down
6 changes: 6 additions & 0 deletions frontend/src/data/settings.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import { createResource } from "frappe-ui"

export const settings = createResource({
url: "hrms.api.get_hr_settings",
auto: true,
})
1 change: 1 addition & 0 deletions hrms/api/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ def get_hr_settings() -> dict:
return frappe._dict(
allow_employee_checkin_from_mobile_app=settings.allow_employee_checkin_from_mobile_app,
allow_geolocation_tracking=settings.allow_geolocation_tracking,
prevent_self_leave_approval=settings.prevent_self_leave_approval,
)


Expand Down
18 changes: 16 additions & 2 deletions hrms/hr/dashboard_chart/appraisal_overview/appraisal_overview.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,29 @@
"idx": 0,
"is_public": 0,
"is_standard": 1,
"modified": "2026-01-10 15:16:33.659637",
"modified": "2026-03-26 15:50:08.184379",
"modified_by": "Administrator",
"module": "HR",
"name": "Appraisal Overview",
"number_of_groups": 0,
"owner": "Administrator",
"report_name": "Appraisal Overview",
"roles": [
{}
{
"role": "System Manager"
},
{
"role": "HR Manager"
},
{
"role": "HR User"
},
{
"role": "Employee Self Service"
},
{
"role": "Employee"
}
],
"show_values_over_chart": 0,
"time_interval": "Yearly",
Expand Down
21 changes: 16 additions & 5 deletions hrms/hr/dashboard_chart/claims_by_type/claims_by_type.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"based_on": "",
"chart_name": "Claims by Type",
"chart_type": "Group By",
"creation": "2022-08-31 23:04:43.377345",
"creation": "2025-07-15 13:15:12.796881",
"docstatus": 0,
"doctype": "Dashboard Chart",
"document_type": "Expense Claim Detail",
Expand All @@ -13,15 +13,26 @@
"idx": 0,
"is_public": 1,
"is_standard": 1,
"last_synced_on": "2022-09-16 11:36:29.484579",
"modified": "2022-09-16 11:39:08.205987",
"last_synced_on": "2026-03-26 15:47:23.289876",
"modified": "2026-03-26 15:47:44.955110",
"modified_by": "Administrator",
"module": "HR",
"name": "Claims by Type",
"number_of_groups": 0,
"owner": "Administrator",
"parent_document_type": "Expense Claim",
"roles": [],
"roles": [
{
"role": "System Manager"
},
{
"role": "HR Manager"
},
{
"role": "HR User"
}
],
"show_values_over_chart": 0,
"source": "",
"time_interval": "Yearly",
"timeseries": 0,
Expand All @@ -30,4 +41,4 @@
"use_report_chart": 0,
"value_based_on": "",
"y_axis": []
}
}
21 changes: 16 additions & 5 deletions hrms/hr/dashboard_chart/employees_by_age/employees_by_age.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"based_on": "",
"chart_name": "Employees by Age",
"chart_type": "Custom",
"creation": "2022-08-22 19:07:51.906347",
"creation": "2025-07-15 13:15:12.774524",
"custom_options": "{\n\t\"colors\": [\"#7cd6fd\"],\n\t\"barOptions\": {\"spaceRatio\": 0.5}\n}",
"docstatus": 0,
"doctype": "Dashboard Chart",
Expand All @@ -13,15 +13,26 @@
"idx": 0,
"is_public": 1,
"is_standard": 1,
"last_synced_on": "2022-08-22 19:00:02.464180",
"modified": "2022-08-22 19:11:20.076166",
"last_synced_on": "2026-03-26 15:46:28.262525",
"modified": "2026-03-26 15:46:47.145092",
"modified_by": "Administrator",
"module": "HR",
"name": "Employees by Age",
"number_of_groups": 0,
"owner": "Administrator",
"parent_document_type": "",
"roles": [],
"roles": [
{
"role": "System Manager"
},
{
"role": "HR Manager"
},
{
"role": "HR User"
}
],
"show_values_over_chart": 0,
"source": "Employees by Age",
"time_interval": "Yearly",
"timeseries": 0,
Expand All @@ -30,4 +41,4 @@
"use_report_chart": 0,
"value_based_on": "",
"y_axis": []
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"based_on": "",
"chart_name": "Hiring vs Attrition Count",
"chart_type": "Custom",
"creation": "2022-08-21 22:58:12.740936",
"creation": "2025-07-15 13:15:12.786726",
"custom_options": "{\n\t\"type\": \"axis-mixed\",\n\t\"axisOptions\": {\n\t\t\"xIsSeries\": 1\n\t},\n\t\"lineOptions\": {\n\t \"regionFill\": 1\n\t},\n\t\"colors\": [\"#7cd6fd\", \"#5e64ff\"]\n}",
"docstatus": 0,
"doctype": "Dashboard Chart",
Expand All @@ -13,15 +13,26 @@
"idx": 0,
"is_public": 1,
"is_standard": 1,
"last_synced_on": "2022-08-22 10:57:55.011020",
"modified": "2022-08-22 11:03:30.080835",
"last_synced_on": "2026-03-26 15:45:20.553274",
"modified": "2026-03-26 15:46:19.045676",
"modified_by": "Administrator",
"module": "HR",
"name": "Hiring vs Attrition Count",
"number_of_groups": 0,
"owner": "Administrator",
"parent_document_type": "",
"roles": [],
"roles": [
{
"role": "System Manager"
},
{
"role": "HR Manager"
},
{
"role": "HR User"
}
],
"show_values_over_chart": 0,
"source": "Hiring vs Attrition Count",
"time_interval": "Yearly",
"timeseries": 0,
Expand All @@ -30,4 +41,4 @@
"use_report_chart": 0,
"value_based_on": "",
"y_axis": []
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"based_on": "",
"chart_name": "Timesheet Activity Breakup",
"chart_type": "Group By",
"creation": "2022-08-21 14:31:10.401241",
"creation": "2025-07-15 13:15:12.817847",
"docstatus": 0,
"doctype": "Dashboard Chart",
"document_type": "Timesheet Detail",
Expand All @@ -14,15 +14,29 @@
"idx": 0,
"is_public": 1,
"is_standard": 1,
"last_synced_on": "2022-08-21 17:55:44.318686",
"modified": "2022-08-21 17:59:38.576219",
"last_synced_on": "2026-04-16 17:14:16.020107",
"modified": "2026-04-16 17:18:58.677457",
"modified_by": "Administrator",
"module": "HR",
"name": "Timesheet Activity Breakup",
"number_of_groups": 0,
"owner": "Administrator",
"parent_document_type": "Timesheet",
"roles": [],
"roles": [
{
"role": "System Manager"
},
{
"role": "HR Manager"
},
{
"role": "HR User"
},
{
"role": "Employee"
}
],
"show_values_over_chart": 0,
"source": "",
"time_interval": "Yearly",
"timeseries": 0,
Expand All @@ -31,4 +45,4 @@
"use_report_chart": 0,
"value_based_on": "",
"y_axis": []
}
}
15 changes: 8 additions & 7 deletions hrms/hr/doctype/daily_work_summary/daily_work_summary.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
],
"in_create": 1,
"links": [],
"modified": "2024-09-18 13:30:28.136511",
"modified": "2026-04-16 12:52:47.429304",
"modified_by": "Administrator",
"module": "HR",
"name": "Daily Work Summary",
Expand All @@ -46,19 +46,20 @@
"read": 1,
"role": "Employee"
},
{
"read": 1,
"role": "HR User"
},
{
"delete": 1,
"email": 1,
"export": 1,
"print": 1,
"read": 1,
"report": 1,
"role": "HR User",
"share": 1
"role": "HR Manager"
}
],
"quick_entry": 1,
"row_format": "Dynamic",
"sort_field": "creation",
"sort_order": "DESC",
"states": []
}
}
9 changes: 8 additions & 1 deletion hrms/hr/doctype/employee_onboarding/employee_onboarding.json
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@
],
"is_submittable": 1,
"links": [],
"modified": "2026-02-05 13:46:25.874832",
"modified": "2026-03-24 17:13:19.990319",
"modified_by": "Administrator",
"module": "HR",
"name": "Employee Onboarding",
Expand Down Expand Up @@ -207,6 +207,13 @@
"share": 1,
"submit": 1,
"write": 1
},
{
"create": 1,
"read": 1,
"report": 1,
"role": "HR User",
"write": 1
}
],
"row_format": "Dynamic",
Expand Down
Loading
Loading