{
  "markdown": "# odoo-timesheet — Claude Code Plugin\n\nAuto-log your Claude Code sessions as Odoo timesheets. Tracks time spent, token usage, and uses AI to match your work to existing project tasks.\n\n## Install\n\n```bash\n/plugin install odoo-timesheet@sadeem-marketplace\n```\n\nThen run setup to configure your Odoo connection and register the tracking hooks:\n\n```bash\n/odoo-timesheet:setup\n```\n\n## Quick Start\n\n```bash\n# 1. Configure connection + register hooks\n/odoo-timesheet:setup\n\n# 2. Test connection\n/odoo-timesheet:test\n\n# 3. Work normally — timesheets log automatically when sessions end\n```\n\n## How It Works\n\n1. **Session starts** — `UserPromptSubmit` hook records the start time on your first message\n2. **Session ends** — `Stop` hook calculates duration, fetches your Odoo tasks, and asks Claude to match the work to a task\n3. **Claude picks a task** — responds with `{\"action\": \"match\", \"task_id\": X}` or `{\"action\": \"create\", \"task_name\": \"...\"}`\n4. **Timesheet logged** — entry created on `account.analytic.line` with duration, tokens, and summary\n\n## Configuration\n\nConfig is **project-scoped** — each project has its own `config.json`.\n\nResolution order:\n1. `$CLAUDE_PROJECT_DIR/.claude/odoo-timesheet/config.json`\n2. Auto-detect: walks up from cwd to find a dir with `.git` or `.claude`\n3. Global fallback: `~/.claude/plugins/data/odoo-timesheet/config.json`\n\n| Key | Description | Default |\n|-----|-------------|---------|\n| `odoo_url` | Odoo server URL | required |\n| `odoo_db` | Database name | required |\n| `odoo_user` | Login email | required |\n| `odoo_password` | Password or API key | required |\n| `project_id` | Odoo project ID (from URL: `/odoo/project/NUMBER`) | required |\n| `employee_id` | Employee ID — auto-detected if not set | null |\n| `ai_matching` | `\"claude_code\"` (AI) or `\"keyword\"` (offline) | `\"claude_code\"` |\n| `auto_create_task` | Create a new task if nothing matches | true |\n| `min_duration_seconds` | Minimum session length to log | 30 |\n| `task_name_prefix` | Prefix added to auto-created task names (e.g. `[Claude] `) | `\"\"` |\n\n## Commands\n\n| Command | Description |\n|---------|-------------|\n| `/odoo-timesheet:setup` | Configure Odoo connection and register hooks |\n| `/odoo-timesheet:test` | Verify connection and list project tasks |\n| `/odoo-timesheet:log` | Manually trigger logging for the current session |\n\n## What Gets Logged\n\nEach entry on `account.analytic.line` contains:\n- **Date**: today\n- **Hours**: actual session duration\n- **Task**: matched from your project or newly created\n- **Employee**: auto-detected from your Odoo user\n- **Note**: `[task summary] | [tokens: X,XXX] | [session: YYYYMMDD_HHMMSS]`\n\n## Plugin Structure\n\n```\nodoo-timesheet/\n├── .claude-plugin/\n│   └── plugin.json              ← manifest\n├── commands/\n│   ├── setup.md                 ← /odoo-timesheet:setup\n│   ├── log.md                   ← /odoo-timesheet:log\n│   └── test.md                  ← /odoo-timesheet:test\n├── hooks/\n│   └── hooks.json               ← UserPromptSubmit + Stop hook definitions\n├── scripts/\n│   ├── odoo_connector.py        ← Odoo XML-RPC client (zero deps)\n│   ├── utils.py                 ← config, session, and state helpers\n│   ├── session_start.py         ← records session start time\n│   ├── session_stop.py          ← calculates duration, fetches tasks\n│   ├── odoo_log.py              ← finalises timesheet after task match\n│   ├── install_hooks.py         ← registers hooks into ~/.claude/settings.json\n│   └── test_connection.py       ← connection test\n├── skills/\n│   └── odoo-timesheet/\n│       └── SKILL.md             ← context-aware guidance for Claude\n└── README.md\n```\n\n## Requirements\n\n- Python 3.10+ (stdlib only — no pip installs needed)\n- Odoo 14–18 with Project + Timesheets modules enabled\n- For Odoo Online: API key required (Settings → Users → your user → API Keys tab)\n- An `hr.employee` record linked to your Odoo user (for the employee field on timesheets)\n\n## Troubleshooting\n\n**Sessions not being logged**\n- Run `/odoo-timesheet:test` to verify the connection\n- Check the session was longer than `min_duration_seconds` (default 30s)\n- Run `/odoo-timesheet:setup` again to ensure hooks are registered in `~/.claude/settings.json`\n\n**Authentication errors (403 / Access Denied)**\n- Odoo Online requires an API key, not your login password\n- Generate one at: Settings → Users & Companies → Users → your user → API Keys tab\n- Self-hosted Odoo accepts username + password directly\n\n**Employee not found**\n- Ask your Odoo admin to link your user to an `hr.employee` record\n- Or set `employee_id` manually in the config file\n",
  "bytes": 4597,
  "sha": "f57170aedb7e9df240d1097fe08580552f63a19afac49beac4de396113b0349d",
  "repo_slug": "sadeem-cloud/claude_odoo_timesheet_plugin",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/plg_sadeem_cloud_claude_odoo_timesheet_plugi_ed48da94/readme"
}