Allow creating transactions without payee #89
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview
actualpy
fails to create a transaction without a payee.When a default (payee='') payee value is used,
actualpy
searches for a payee with an empty name and expects to find only one such payee. Actual Budget uses special payees to represent transfers between accounts. Such payees always have an empty name. If a budget has more than one transfer payee,create_transaction
will fail becauseget_or_create_payee
will find multiple payees with empty names and fail validation.When a
None
payee value is passed,create_transaction
succeeds, but thenActual
errors because of a invalid payee (I haven't captured the exact error, but you can easily reproduce this but callingcreate_transaction(..., payee=None)
) and then editing this transaction in Actual.Solution
This proposal adds support for the
None
payee value increate_transaction
.When a
None
value is passed, the implementation does not attempt to create a payee, and passesNone
as a payee_id increate_transaction_from_ids
.The proposed implementation should be backward compatible.