odoo-work-cli clock edit¶
NAME¶
odoo-work-cli-clock-edit - Edit an attendance record's check-in/check-out time
SYNOPSIS¶
odoo-work-cli clock edit [--date YYYY-MM-DD] [--id ID] [--in TIME] [--out TIME] [--json | --format FORMAT]
odoo-work-cli clock edit --create-only [--date YYYY-MM-DD] --in TIME --out TIME [--json | --format FORMAT]
DESCRIPTION¶
Edit the check-in and/or check-out time of an attendance record.
By default the record of the given day (--date, default today) is edited. If the day has several records, select one with --id. If the day has no record yet, one is created when both --in and --out are given. The old and the new values are printed. Use 'clock list' to see the existing records first.
With --create-only the command only ever creates: if the day already has a record it aborts with a "conflict" error and changes nothing. Use it when backfilling days, so that an existing record is never overwritten.
Times are HH:MM on --date or "YYYY-MM-DD HH:MM". A time more than one minute in the future, or a check-out not after the check-in, is a validation error. --id with a record of another day is not_found.
Editing attendance over the API requires the 'Attendance Officer' access right, with you set as your own attendance manager.
OPTIONS¶
--create-only-
Only create; abort with a conflict error if the day already has a record.
flag; optional
--dateYYYY-MM-DD-
Day of the record to edit, YYYY-MM-DD.
string; optional; default: today
--idID-
ID of the attendance record (required if the day has several records).
integer; optional
--inTIME-
New check-in TIME, HH:MM or "YYYY-MM-DD HH:MM".
string; optional
--outTIME-
New check-out TIME, HH:MM or "YYYY-MM-DD HH:MM".
string; optional
GLOBAL OPTIONS¶
--formatFORMAT-
Output FORMAT: table, json or jsonl.
one of table, json, jsonl; optional; default: table
--json-
Shorthand for --format json.
flag; optional
--backendBACKEND-
BACKEND: odoo or fake (offline, made-up data; env ODOO_WORK_CLI_BACKEND).
string; optional; default: odoo; env: ODOO_WORK_CLI_BACKEND
--configFILE-
Read only the config FILE (skip discovery).
string; optional
-h,--help- Print the help of the command and exit.
OUTPUT¶
"Updated attendance #ID" with the old (was) and the new (now) check-in, check-out and duration; or "Created attendance #ID: FROM - TO".
With --json the record as it is now plus before, the record before the edit (null when it was created).
Fields of attendance_edit.schema.json:
id- integer
employee_id- integer or null
employee- string or null
check_in- string (RFC 3339 timestamp)
check_out- string (RFC 3339 timestamp) or null
running- boolean
worked_hours- number
worked_minutes- integer
before-
The record before the edit; null when the edit created it.
null or object (attendance.schema.json)
ENVIRONMENT¶
ODOO_URL- Odoo server URL; overrides url from the config files.
ODOO_DATABASE- Odoo database name; overrides database.
ODOO_USERNAME- Odoo login, usually an e-mail address; overrides username.
ODOO_PASSWORD- Odoo API key, used for XML-RPC. Despite the name, not the login password.
ODOO_WEB_PASSWORD- Odoo login password, used for the web session of clock in and clock out.
ODOO_TOTP_SECRET- TOTP secret (base32 or otpauth:// URL) for accounts with two-factor authentication.
ODOO_OP_TIMEOUT- Timeout of the 1Password call that resolves [op_secrets], a Go duration; default 5s.
ODOO_WORK_CLI_NO_OP- If 1, true, yes or on, [op_secrets] is ignored and the 1Password CLI is never called.
ODOO_WORK_CLI_BACKEND- Backend, odoo (default) or fake; --backend overrides it.
ODOO_WORK_CLI_FAKE_STATE- State file of the fake backend; default odoo-work-cli-fake-state.json in the temporary directory.
XDG_CONFIG_HOME- Base directory of the global config file; default ~/.config.
FILES¶
~/.config/odoo-work-cli/config.toml- Global configuration ($XDG_CONFIG_HOME/odoo-work-cli/config.toml if XDG_CONFIG_HOME is set). Created by odoo-work-cli config install.
.odoo-work-cli.toml- Configuration of a directory tree. Every such file from the filesystem root down to the current directory is merged over the global file, the deepest last. --config FILE loads only FILE instead.
$TMPDIR/odoo-work-cli-fake-state.json- State of the fake backend (--backend fake); ODOO_WORK_CLI_FAKE_STATE sets another path. Delete it to start over with the seed data.
EXIT STATUS¶
0 on success, 1 on any error, including usage errors. With --json or --format json|jsonl the error is printed on standard output as one JSON object, {"error": {"kind": KIND, "message": TEXT}}, and nothing on standard error; otherwise as "Error: TEXT" on standard error, after usage errors followed by the usage.
Error kinds this command can fail with:
auth- Authentication failed: wrong API key or login password, TOTP rejected.
access_denied- Odoo's access rules forbid the operation, e.g. attendance writes without the Attendance Officer right.
not_found- The record does not exist or is not visible.
validation- Invalid input: unknown flag, bad argument, malformed date, time or hours, a time in the future, an unknown project.
conflict- The request contradicts the current state, e.g. clock in while clocked in, or an overlapping attendance record.
network- Odoo cannot be reached: DNS, connection refused, timeout, TLS.
config- The local configuration is missing or invalid.
secrets_locked- 1Password is locked or unreachable, so op:// references could not be resolved.
internal- Anything else: an unexpected Odoo response or a bug.
EXAMPLES¶
Correct the check-in of a day with one record:
$ odoo-work-cli clock edit --date 2026-04-07 --in 08:00
Updated attendance #4605
was: 2026-04-07 08:10 - 16:40 (8:30)
now: 2026-04-07 08:00 - 16:40 (8:40)
A day with several records needs --id:
$ odoo-work-cli clock edit --date 2026-04-08 --id 4607 --out 17:30
Updated attendance #4607
was: 2026-04-08 12:30 - 17:00 (4:30)
now: 2026-04-08 12:30 - 17:30 (5:00)
Backfill a day, but never overwrite an existing record:
$ odoo-work-cli clock edit --date 2026-04-06 --in 09:00 --out 13:00 --create-only
Created attendance #5000: 2026-04-06 09:00 - 13:00