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.