Fixed and set the txn_type to the form in the make_txn_form_from_model() utility in the accounting application.

This commit is contained in:
依瑪貓 2020-08-06 15:46:43 +08:00
parent 1d79e970c4
commit 9a9f715349

View File

@ -498,6 +498,7 @@ def make_txn_form_from_model(txn_type, txn):
{x: str(getattr(txn, x)) for x in ["date", "notes"]
if getattr(txn, x) is not None})
form.transaction = txn if txn.pk is not None else None
form.txn_type = txn_type
records = []
if txn_type != "income":
records = records + txn.debit_records