Skip to Content
Catalog / HR · Human Resources / AlshayebCo HR Mobile — Fleet
AlshayebCo HR Mobile — Fleet
alshayeb_hr_mobile_fleet

AlshayebCo HR Mobile — Fleet

Let drivers log company-vehicle trips and mileage from the HR mobile app

v19.0.1.0.0 AlshayebCo Human Resources

Adds the fleet trip model (chatter chatter, ir.sequence-numbered name, stored computed distance, GPS digits(10,6) fields, and a CHECK constraint guarding the odometer) and a http.Controller exposing five type='jsonrpc', auth='user' endpoints under /hr_attendance/mobile/fleet/* (vehicles, trips/list, trips/start, trips/end, trips/detail). Endpoints run via sudo() gated by an explicit employee_id filter and return stable string error codes. On trip end, the controller delegates to action_end(), which writes end data and pushes the reading to fleet vehicle odometer when the direct vehicle write is rejected. Depends on alshayeb_hr_mobile (reuses its @safe_endpoint wrapper) and fleet.

Overview

Field staff and company drivers need a simple way to record which vehicle they used, when, and how far they drove — without sitting at a desk. This module adds a fleet trip log and the JSON-RPC endpoints the AlshayebCo HR mobile app calls to start and end trips, capture odometer readings and GPS coordinates, and tie each trip to a driver, vehicle, and optional project. Completed trips automatically push the latest mileage back into Odoo Fleet, keeping vehicle odometers current with no manual data entry.

Workflow

Fleet Trip

Active
Completed
Cancelled

Key Features

  • Adds a Fleet Trip log that records driver, vehicle, project, start/end times, odometer readings, and purpose.
  • Drivers start and end trips from the mobile app, with one active trip enforced per driver at a time.
  • Computes trip distance automatically from start and end odometer readings.
  • Captures GPS coordinates at both the start and end of each trip.
  • Syncs the vehicle's odometer in Odoo Fleet to the latest reading when a trip is completed.
  • Auto-numbers every trip with a TRIP/00001-style sequence reference.
  • Exposes search-and-list of company vehicles, flagging the one assigned to the current driver.
  • Tracks key changes (vehicle, odometer, state) on the trip's chatter for an audit trail.
  • Blocks an end odometer reading that is lower than the start reading via a database constraint.

Technical Details

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

Security

Every employee (Internal User) can read, create, and edit their own fleet trips, and an ir.rule restricts ordinary users to trips where they are the driver. HR Managers and Fleet Managers can see and manage all trips, including deletion. The mobile endpoints additionally scope every read and write to the calling user's own employee record.

Internal User (base.group_user) — create/edit own trips only HR Manager (hr.group_hr_manager) — full access to all trips Fleet Manager (fleet.fleet_group_manager) — full access to all trips

Dependencies