From 26eb9d457979fcf631f12ec4d271c867471e5f1b Mon Sep 17 00:00:00 2001 From: Padreug Date: Wed, 17 Jun 2026 10:06:57 +0200 Subject: [PATCH] fix(accounts): don't currency-constrain per-user account opens (libra-#49) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit get_or_create_user_account opened per-user receivable/payable accounts constrained to EUR/SATS/USD, so a posting in any other currency tripped 'Invalid currency CAD/GBP/JPY for account Assets:Receivable:User-…' at bean-check — the exact errors the optional-currencies work set out to fix, which had only reached the admin chart-account path. Open user accounts unconstrained (currencies=None) so they hold arbitrary fiat. Co-Authored-By: Claude Opus 4.8 (1M context) --- crud.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/crud.py b/crud.py index b2b43dd..0692806 100644 --- a/crud.py +++ b/crud.py @@ -250,9 +250,13 @@ async def get_or_create_user_account( if not fava_account_exists: # Create account in Fava/Beancount via Open directive logger.info(f"[FAVA CREATE] Creating account in Fava: {account_name}") + # Unconstrained Open: a per-user receivable/payable legitimately + # holds arbitrary fiat (CAD/GBP/JPY/…). Constraining it to + # EUR/SATS/USD made any posting in another currency fail + # bean-check (the errors this account path originally exhibited). await fava.add_account( account_name=account_name, - currencies=["EUR", "SATS", "USD"], # Support common currencies + currencies=None, metadata={ "user_id": user_id, "description": f"User-specific {account_type.value} account"