Skip to Content
Catalog / HR · Human Resources / AlshayebCo HR Mobile — Expenses
AlshayebCo HR Mobile — Expenses
alshayeb_hr_mobile_expenses

AlshayebCo HR Mobile — Expenses

Let employees file and submit expenses with receipt photos from the HR mobile app

v19.0.1.0.0 AlshayebCo Human Resources

Backend-only extension of the AlshayebCo HR Mobile API. A single http.Controller (AlshayebHrMobileExpenses) registers four type='jsonrpc', auth='user' routes under /hr_attendance/mobile/expenses/ (categories, list, create, submit), each wrapped by the shared @safe_endpoint decorator from alshayeb_hr_mobile. No models, views, menus, or security CSV are added; it wraps hr.expense and product product. Reads/writes use sudo() with an explicit employee_id domain filter as the privilege gate. Submitting calls hr.expense.action_submit(); receipts are stored as ir.attachment records.

Overview

Field and remote staff need to log out-of-pocket expenses the moment they happen, but the standard Odoo expense workflow assumes a desktop login and Expenses-group access. This module adds four JSON-RPC endpoints to the AlshayebCo HR Mobile API so the companion Flutter app can list expense categories, browse an employee's own expense history, file a new expense with an optional receipt photo, and submit drafts to a manager. Every call is scoped to the caller's own employee record, so ordinary staff can manage only their own expenses without holding any Accounting or Expenses permission.

Workflow

Hr Expense

To Submit
Submitted
Approved
Refused
Posted
In Payment
Paid

Key Features

  • Lists selectable expense categories from products flagged as expensable, with a suggested default amount each.
  • Returns an employee's own expense history, paginated and filterable by status and calendar year.
  • Creates a new draft expense for the logged-in employee with title, category, amount, and date.
  • Attaches a base64 receipt photo or PDF to the expense, keeping the expense even if the upload fails.
  • Submits one or more draft expenses to the manager in a single call, reporting per-expense success or failure.
  • Scopes every read and write to the caller's own employee record so staff see only their own expenses.
  • Returns each expense with amount, currency, status, and approval state ready for mobile display.
  • Uses stable, documented error codes so the mobile app can handle every failure case predictably.

Technical Details

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

Security

No access-control records or security groups are defined. Endpoints require a logged-in user (auth='user') and run as sudo, but every query is gated by the caller's own employee record, so each employee can only file, view, and submit their own expenses. All approval and accounting logic stays inside standard hr_expense permissions.

Dependencies

alshayeb_hr_mobile hr_expense