--- title: TimeTrackr Integration url: https://blog.guigpap.com/en/workflows/timetrackr/ url_md: https://blog.guigpap.com/en/workflows/timetrackr.md category: automation date: '2026-03-28' maturite: production techno: - n8n - odoo application: - automation - business --- # TimeTrackr Integration > Bridge between the desktop time-tracking app and Odoo timesheets through N8N webhooks ## 1. What? — Definition and context TimeTrackr is a desktop time-tracking application. When you start a timer on a project and stop it, the time entry has to land in Odoo as a timesheet. Two N8N webhooks bridge the gap: one provides the project and task list for the desktop client's drop-down menus, the other receives time entries and turns them into Odoo analytic lines. > **Note - Odoo timesheet** > > A **timesheet** in Odoo (`account.analytic.line`) is a line of time spent on a project. It links an employee, a project, a task, a duration and a description. It is the foundation for billing and reporting. ### Two workflows | Workflow | Nodes | Endpoint | Role | |----------|-------|----------|------| | **TimeTrackr Projects** | 5 | GET `/webhook/timetrackr-projects` | Project + task list for dropdown | | **TimeTrackr Entries** | 12 | POST `/webhook/timetrackr-entries` | Odoo timesheet creation | ### Data flow ```mermaid flowchart TD TT["TimeTrackr Desktop"] subgraph Projects["TimeTrackr Projects · 5n"] direction TB GET["GET /webhook/timetrackr-projects"] Filter["Filter projects · x_github_sync_enabled"] Group["Group tasks by project"] end subgraph Entries["TimeTrackr Entries · 12n"] direction TB POST["POST /webhook/timetrackr-entries"] Loop["Loop entries · continueOnFail"] Mapping["Lookup timetrackr_user_mapping"] Create["Create account.analytic.line · Odoo"] end TT -->|select project| GET --> Filter --> Group --> TT TT -->|submit batch| POST --> Loop --> Mapping --> Create ``` --- ## 2. Why? — Stakes and motivations ### Problems solved | Problem | Without integration | With integration | |---------|---------------------|------------------| | **Double entry** | Timer + manual entry inside Odoo | Automatic | | **Out-of-sync projects** | Different lists in each app | Dropdown fed by Odoo | | **Attribution errors** | Wrong project or wrong task | ID-based mapping | --- ## 3. How? — Technical implementation ### Authentication Both endpoints rely on a token in the HTTP header: | Header | Usage | |--------|-------| | `X-TimeTrackr-Token` | Token shared between the desktop client and N8N | The webhooks are exposed through Caddy (external access allowed, unlike the internal webhooks). ### Projects endpoint The workflow fetches Odoo projects where `x_github_sync_enabled = true`, then the active tasks (excluding Done/Cancelled) grouped per project. The reply is JSON ready for the client's drop-downs. ### Entries endpoint The payload arrives as a batch: ```json { "version": 1, "entries": [ { "project_id": 5, "task_id": 42, "description": "Fix login bug", "duration": 1.5, "date": "2026-03-28", "username": "guillaume" } ] } ``` For every entry, the workflow: 1. Looks up the employee ID in the `timetrackr_user_mapping` Data Table (`guillaume` → employee 1) 2. Creates an `account.analytic.line` row in Odoo 3. Keeps going even if one entry fails (`continueOnFail`) > **Caution - User mapping** > > The username → employee_id mapping lives in the `timetrackr_user_mapping` Data Table. If a user is unmapped, the entry fails silently (logged but not created). --- ## 4. What if? — Outlook and limits ### Current limits | Limit | Impact | Mitigation | |-------|--------|------------| | **No reverse sync** | Odoo timesheets not visible in TimeTrackr | TimeTrackr has its own view | | **Manual mapping** | Add each user to the Data Table | Single user today | ### Evolution scenarios **If multi-user**: - Auto-discovery of Odoo employees - Mapping by email instead of username --- ## Related pages ### Infrastructure - [Odoo 18 on Docker](/en/infrastructure/odoo-18-setup/) — Timesheets and projects ### Workflows - [Claude Code Telemetry](/en/workflows/claude-code-telemetry/) — Another source of automatic timesheets ## Metadonnees agent - Cet article est issu du blog GuiGPaP Lab. - Contexte global du blog: https://blog.guigpap.com/llms.txt - Contact auteur: https://odoo.guigpap.com/mon-cv - Licence: CC-BY-SA 4.0