Your first booking¶
In this tutorial you connect odoo-work-cli to your Odoo 17, check the
connection and book your first timesheet entry. You need an Odoo account
that can book timesheets and about fifteen minutes.
1. Install¶
Other ways: Install and update.
2. Create an Odoo API key¶
Odoo 17 does not accept your login password for API access. It wants an
API key. In Odoo, open your avatar → My Profile → Account Security →
New API Key (or Settings → Users → your user → API Keys). Give it a name
such as odoo-work-cli and copy the key; Odoo shows it only once.
Why a key and not your password: Two transports.
3. Create the config file¶
This writes ~/.config/odoo-work-cli/config.toml. Open it and set three
values:
url = "https://odoo.example.com" # your Odoo, without a path
database = "odoo" # the database name
username = "you@example.com" # your login
Do not put the API key in this file; it would be rejected.
4. Provide the API key¶
For this tutorial, an environment variable is enough:
Yes, the variable is called ODOO_PASSWORD, and it holds the API key. To keep
the key in 1Password instead, see Secrets.
5. Check the connection¶
You see your user ID, name, login and company. An error of kind auth means
the key is wrong or is a password; see
Troubleshoot.
6. Find the project¶
Search for part of the project name or the customer:
Note the project ID and, if you book on a task, the task ID.
7. Preview the entry¶
odoo-work-cli entries add --project-id 42 --task-id 10 --hours 1:30 \
--description "Code review" --dry-run
Hours are 1:30 or 1.5. The date defaults to today; add --date 2026-09-14
for another day. The dry run prints the entry and writes nothing. It warns
when the same entry already exists.
8. Book it¶
Run the same command without --dry-run:
odoo-work-cli entries add --project-id 42 --task-id 10 --hours 1:30 \
--description "Code review"
odoo-work-cli entries
entries without flags lists the current week. Your entry is there, with
status draft.
Next¶
- Book and fix entries in the grid: A tour of the TUI.
- Clock in and out: Clock in and out. It needs your login password as well; Secrets says why.