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:
Herculino Trotta committed 2026-11-14 02:13:21 -03:00
1 parent 5459865366
commit 188876fdf0
6 files changed
+236 -8

No files matched your search

+4
View File
@@ -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,