odoo-work-cli fields¶
NAME¶
odoo-work-cli-fields - Inspect Odoo model fields
SYNOPSIS¶
DESCRIPTION¶
Print the fields of the Odoo model MODEL with their type, label and whether they are required. Use it to find the technical field names for extra_fields and filters in the configuration, e.g. a custom x_studio_ field.
Common models: project.project (projects), project.task (tasks), account.analytic.line (timesheet entries), hr.attendance (attendance).
OPTIONS¶
None besides the global options.
GLOBAL OPTIONS¶
--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¶
The columns Field, Type, Label and Required. There is no JSON output.
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. The error is printed as "Error: TEXT" on standard error.
Error kinds this command can fail with:
auth- Authentication failed: wrong API key or login password, TOTP rejected.
validation- Invalid input: unknown flag, bad argument, malformed date, time or hours, a time in the future, an unknown project.
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¶
The fields of a project:
$ odoo-work-cli fields project.project
Field Type Label Required
------------------------------ --------------- ------------------------------ --------
name char Name true
partner_id many2one Customer false
company_id many2one Company false