mirror of
https://github.com/eitchtee/WYGIWYH.git
synced 2026-11-29 20:02:51 +01:00
feat(rules): add, change and remove sub-transactions in rules
Adds a Sub-transactions field to edit actions and update-or-create
actions. Expressions get a sub_transactions variable and return a list of
{name, amount}; an empty list removes the parts. Rules skip transfers, and
setting the amount of a split transaction is skipped.
This commit is contained in:
1 parent
5459865366
commit
188876fdf0
6 files changed
+236
-8
No files matched your search
@@ -86,6 +86,10 @@ def serialize_transaction(sender: Transaction, deleted: bool):
|
||||
"notes": sender.notes,
|
||||
"tags": list(sender.tags.values_list("id", "name")),
|
||||
"entities": list(sender.entities.values_list("id", "name")),
|
||||
"sub_transactions": [
|
||||
{"name": name, "amount": str(amount)}
|
||||
for name, amount in sender.sub_transactions.values_list("name", "amount")
|
||||
],
|
||||
"deleted": deleted,
|
||||
"internal_note": sender.internal_note,
|
||||
"internal_id": sender.internal_id,
|
||||
|
||||
Reference in new issue
Block a user