Skip to Content
Catalog / HR · Human Resources / AlshayebCo HR Mobile — Live Tracking
AlshayebCo HR Mobile — Live Tracking
alshayeb_hr_mobile_tracking

AlshayebCo HR Mobile — Live Tracking

Give field-team managers a live, opt-in map of where their on-duty staff are right now

v19.0.1.0.0 AlshayebCo Human Resources

Adds the location log model (employee_id, user_id related-stored, timestamp, latitude/longitude, accuracy, battery_pct, source selection, attendance_id) plus tracking_opt_in and tracking_interval_seconds fields on hr.employee and hr.employee.public. Exposes four JSON-RPC v2 controllers under /hr_attendance/mobile/tracking/ (ping, team/latest, employee/history, settings), all auth='user', csrf=False, wrapped in alshayeb_hr_mobile's @safe_endpoint. Manager scoping reuses manager_scope_for/employee_filter_for from the parent module (roles: all/company/team/none) and the team-latest view uses _read_group(id:max) for one-query latest-per-employee. Security via ir.model.access.csv + three ir.rule records; a daily ir.cron calls _vacuum_pings() to unlink pings older than 30 days. Depends only on alshayeb_hr_mobile.

Overview

Managers of mobile and field workforces have no easy way to see where on-duty staff are during the day. This module extends the AlshayebCo HR Attendance mobile app with consent-based live location tracking: employees opt in, their phone sends periodic GPS pings, and managers fetch a live team view scoped strictly to their own direct reports. It stores each point in a dedicated log model, enforces opt-in on the server, and automatically purges location data older than 30 days to keep tracking privacy-respecting and storage lean.

Key Features

  • Records timestamped GPS pings (latitude, longitude, accuracy, battery level, source) per employee in a dedicated hr.location.ping log.
  • Per-employee opt-in toggle and configurable ping interval (60–3600 seconds), so tracking only happens with explicit consent.
  • Server-side opt-in enforcement rejects any ping submitted by an employee who has not opted in.
  • Validates and sanitises incoming coordinates and clamps stale client timestamps to prevent bad or backdated data.
  • Manager team-map endpoint returns the latest position per teammate in a single efficient grouped query, with avatar and check-in/check-out status.
  • Per-employee location-trail history endpoint scoped to a chosen time window (default 8 hours) for reviewing a worker's route.
  • Manager access is restricted to their own reporting line via record rules — team leads see only direct reports, HR managers see all.
  • Daily auto-vacuum cron permanently deletes location pings older than 30 days for data minimisation.
  • Tags each ping by source (attendance event, periodic, or manual) and links it to the originating attendance record when available.

Technical Details

Technical Name alshayeb_hr_mobile_tracking
Version 19.0.1.0.0
License LGPL-3
Domain HR · Human Resources

Security

Two access levels are granted on the location-ping log. All internal users can read, create, and update pings, but record rules limit them to their own employee's points; direct managers can read their team members' pings; and HR Managers have full read/write/create/delete across all records. All four mobile endpoints require an authenticated user, and employees can only ever submit pings for their own employee record.

base.group_user (Internal User) — create/read/update own location pings (own-record rule) hr.group_hr_user (HR Officer / line manager) — read location pings of direct reports hr.group_hr_manager (HR Manager) — full access to all location pings

Dependencies