# HR Expense Account Split & Kiosk This module enhances Odoo's standard Expense workflow by providing account-splitting logic and an **Anonymous Expense Kiosk** for employees. ## 🚀 Features ### 1. Account Splitting - **Dynamic Account Selection**: Automatically routes expenses to different GL accounts based on whether they were paid by the **Employee** (Reimburse) or the **Company** (Kasbon). - **Configuration**: Set distinct `Expense Account (Employee)` and `Expense Account (Company)` directly on the Expense Category form. ### 2. Anonymous Expense Kiosk - **PIN-Protected Access**: Secure employee login via a 4-digit PIN on a tablet/touchscreen interface. - **Two Workflows**: - **New Expense**: Submit a reimbursement request instantly. - **Upload Receipt (Realization)**: Upload physical receipts for approved Kasbon expenses. - **Real-Time Totaling**: Automatically summarizes amounts when multiple receipts are added. ### 3. Multiple Receipt Support - **Dynamic Lines**: Support for adding multiple physical receipts (lines) to a single realization. - **Backend Tracking**: Creates `hr.expense.realization.line` records for each physical receipt, each with its own attachment. ### 4. Image Optimization - **Client-Side Compression**: Photos are automatically resized to **1024px** and compressed to **70% JPEG quality** before upload. - **Fast Experience**: Reduces mobile data usage and saves up to 90% of server storage for receipt images. ### 5. Validation & Security - **Mandatory Receipts**: - Backend prevents submission of employee-paid expenses if no receipt is attached. - Kiosk requires a photo upload for all reimbursement-type expenses. - **Overdue Tracking**: Automatically calculates and highlights overdue receipts for Kasbon realizations. - **Simplified UI**: Standard "Split Expense" and other distracting buttons are hidden in the backend to maintain a focused workflow. ## 🛠 Configuration 1. **GL Accounts**: - Go to **Expenses > Configuration > Expense Categories**. - Under the **Accounting** tab, define the two accounts. 2. **Kiosk Token**: - Each company has a unique Kiosk URL found in the Settings (if implemented/exposed) or using the token: `d56db48c463444c88b86f14980d7a185`. 3. **Employee PINs**: - Ensure employees have a 4-digit PIN set on their HR settings to use the Kiosk. ## 📋 Technical Notes - **Controller**: `/hr_expense/kiosk/` - **Models**: `hr.expense`, `hr.expense.realization`, `hr.expense.realization.line` - **JS Framework**: Odoo 17 OWL (Odoo Web Library)