Category: Frappe HR / Mobile App (PWA)
Version: HRMS v16.53.1, branch version-16
What I’m trying to do
In the Frappe HR mobile app (PWA) I need two things:
- Hide “Request Attendance” and “Request a Shift” from the Home screen Quick Links.
- Disable mobile check-in for some employees only, while the rest continue
to check in normally from the app.
Requirement 1 — Quick Links are hardcoded
Quick Links are a hardcoded array in frontend/src/views/Home.vue (lines 29-65).
No doctype, HR Setting, or config drives this list, and the items render with no
permission check. The same two actions are duplicated as buttons in
frontend/src/views/attendance/Dashboard.vue (lines 6-12 and 32-38).
Requirement 2 — mobile check-in is all-or-nothing
This is the bigger blocker for us.
frontend/src/components/CheckInPanel.vue (line 7) gates the whole panel on a
single flag, allow_employee_checkin_from_mobile_app, returned by
hrms/api/__init__.py → get_hr_settings(). HR Settings is a Single doctype,
so this flag is site-wide. Turning it off hides check-in for every employee;
there is no per-employee or per-role variant.
Our actual use case: field staff should check in from the mobile app, while
office staff must not (they are covered by a biometric device). Today we can
only choose “mobile check-in for everyone” or “for nobody”.
The permission route does not solve it either:
- Removing
createpermission on Employee Checkin does stop the record from
being created, but the “Check In” button still renders. The employee taps it
and gets a permission error, which looks like a bug to them. - Role permissions are doctype-level, not channel-level. So blocking mobile
check-in for an employee also blocks their desk/web check-in. There is no way
to restrict only the mobile channel.
Worth noting: permission-aware rendering already exists elsewhere in the PWA.
frontend/src/components/ListView.vue (line 26) calls
frappe.client.has_permission to conditionally show the create button. The
check-in panel simply does not do the same.
Why the usual customization tools don’t help
The PWA is served from hrms/www/hrms.html, which loads a standalone Vue
bundle. Client Scripts, Customize Form, Workspaces, and Website Theme custom CSS
are not injected into this page, so no desk-side customization tool can reach
these components.
Patching the Vue files works, but apps/hrms tracks the upstream repo, so the
change either conflicts or gets reverted on every bench update unless we
maintain a fork. For a visibility toggle that feels like a lot of ongoing cost.
Questions / suggestions
-
Is there a supported way to control Quick Links visibility that I’ve missed?
-
Could
CheckInPanel.vuerespect the user’screatepermission on Employee
Checkin, the wayListView.vuealready does? This is a small change, follows
an existing pattern in the app, needs no new settings, and would immediately
make mobile check-in role-driven and therefore employee-wise. -
Longer term, would the team consider a per-employee or per-role mobile
check-in setting, for example a field on Employee or Shift Type, instead of
the single site-wide HR Settings flag? -
Same question for a configurable Quick Links list, by role or as a child
table in HR Settings.
Happy to open a GitHub issue or send a PR if there is interest in a particular
approach.