Per-user accounts still currency-constrained to EUR/SATS/USD — CAD/GBP/JPY bean-check errors persist #49

Closed
opened 2026-06-16 21:59:36 +00:00 by padreug · 1 comment
Owner

Found in the high-effort code review of PR #46.

PR #46 made admin-created chart accounts write an unconstrained Open directive (models.py CreateChartAccount.currencies now defaults to None). The model comment justifies this by citing "the CAD/GBP/JPY bean-check errors we saw on user accounts."

But the per-user account path was not changed — crud.py:255 (get_or_create_user_account) still opens accounts constrained to three currencies:

currencies=["EUR", "SATS", "USD"],  # Support common currencies

Those are exactly the accounts that threw Invalid currency CAD for account 'Assets:Receivable:User-…' (also GBP, JPY) in the dev ledger — so the original bug persists on the path that actually exhibits it. The fix landed on the new admin feature instead.

Options

  • Drop the currency constraint on user-account opens too (currencies=None), matching the chart-account behavior, or
  • If user accounts should stay constrained for a reason, correct the models.py comment so it doesn't claim a fix it didn't make.

Recommend the former for consistency, since per-user receivable/payable accounts legitimately hold arbitrary fiat.

Found in the high-effort code review of PR #46. PR #46 made admin-created chart accounts write an **unconstrained** Open directive (`models.py` `CreateChartAccount.currencies` now defaults to `None`). The model comment justifies this by citing "the CAD/GBP/JPY bean-check errors we saw on user accounts." But the per-user account path was not changed — `crud.py:255` (`get_or_create_user_account`) still opens accounts constrained to three currencies: ```python currencies=["EUR", "SATS", "USD"], # Support common currencies ``` Those are exactly the accounts that threw `Invalid currency CAD for account 'Assets:Receivable:User-…'` (also `GBP`, `JPY`) in the dev ledger — so the original bug persists on the path that actually exhibits it. The fix landed on the new admin feature instead. ### Options - Drop the currency constraint on user-account opens too (`currencies=None`), matching the chart-account behavior, **or** - If user accounts should stay constrained for a reason, correct the `models.py` comment so it doesn't claim a fix it didn't make. Recommend the former for consistency, since per-user receivable/payable accounts legitimately hold arbitrary fiat.
Author
Owner

Fixed and shipped in v0.4.0 (PR #46, catalog updated).

26eb9d4get_or_create_user_account now opens per-user accounts unconstrained (currencies=None), so receivable/payable accounts hold arbitrary fiat (CAD/GBP/JPY/…) without tripping bean-check. Verified end-to-end against the real Beancount parser (bean-check clean on a CAD posting to an unconstrained User- account).

Fixed and shipped in **v0.4.0** (PR #46, catalog updated). `26eb9d4` — `get_or_create_user_account` now opens per-user accounts unconstrained (`currencies=None`), so receivable/payable accounts hold arbitrary fiat (CAD/GBP/JPY/…) without tripping bean-check. Verified end-to-end against the real Beancount parser (`bean-check` clean on a CAD posting to an unconstrained `User-` account).
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
aiolabs/libra#49
No description provided.