Description
The appuio-odoo-adapter does not work with month arguments '08' and '09'.
This is because the 'cli' package's "IntFlag" does not use base 10 by default. Instead it auto-detects the base. In case of strings starting with '0', it assumes base 8, hence '08' and '09' are not parseable.
The culprit is here:
https://github.com/urfave/cli/blob/main/flag_int.go#L47
This code should use base 10 by default instead of 0 (auto-detect).
Unfortunately this is not configurable, so I don't see an easy fix, but maybe I'm overlooking something. Personally I would completely remove the 'cli' library and do some simple environment variable parsing instead, but I presume some people will disagree with me on that.
Additional Context
I will try to find a workaround by changing the CronJob such that it supplies the month without leading zero, see https://github.com/appuio/component-appuio-cloud-reporting/blob/master/component/main.jsonnet#L195
Logs
Incorrect Usage: invalid value "08" for flag -month: parse error
NAME:
appuio-odoo-adapter invoice - Create Odoo invoices from APPUiO Cloud
USAGE:
appuio-odoo-adapter invoice [command options] [arguments...]
OPTIONS:
--odoo-url value Odoo ERP URL in the form of https://username:password@host[:port]/db-name (default: <required>) [$OA_ODOO_URL]
--db-url value PostgreSQL URL in the form of postgres://username:password@host[:port]/db-name (default: <required>) [$OA_DB_URL]
--year value Year to generate the report for. (default: 0) [$OA_YEAR]
--month value Month to generate the report for. (default: 0) [$OA_MONTH]
--invoice-defaults-path value Path to a file with invoice defaults. [$OA_INVOICE_DEFAULTS_PATH]
--item-description-templates-path PRODUCT_SOURCE.gotmpl Path to a directory with templates. The Files must be named PRODUCT_SOURCE.gotmpl. (default: "description_templates/") [$OA_ITEM_DESCRIPTION_TEMPLATES_PATH]
--help, -h show help (default: false)
invalid value "08" for flag -month: parse error
Expected Behavior
The argument '08' gets parsed to integer 8, '09' gets parsed to integer 9.
Steps To Reproduce
Run appuio-odoo-adapter with argument "--month 08" or "--month 09".
Versions
v1.4.0