Skip to content
Snippets Groups Projects
Commit 3cf21baa authored by Daniele Nicolodi's avatar Daniele Nicolodi
Browse files

orders: Fix operator precendence issue

This caused the update command to fail to add postings to existing
entries thad did not contain any. Simplify the expression to make it
easier to understand.
parent 21371b1c
Branches
No related tags found
No related merge requests found
......@@ -488,7 +488,9 @@ def update(ctx, output, where, debug, ledger=None):
entry = entry._replace(flag=flag)
account = build_account_name(meta, True) or entry.postings[0].account if entry.postings else None
account = build_account_name(meta, True)
if not account and entry.postings:
account = entry.postings[0].account
amount = meta.get('payment', None) or meta.get('invoice', None) or meta.get('quote', None)
flag = '?' if meta.get('payment', None) else None
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment