Wire admin add-account endpoint into the UI #46
1 changed files with 5 additions and 1 deletions
fix(accounts): don't currency-constrain per-user account opens (libra-#49)
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) <noreply@anthropic.com>
commit
26eb9d4579
6
crud.py
6
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"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue