Revised the fill_transaction_from_form() utility to store the account code instead of the account primary key in the accounting application.

This commit is contained in:
依瑪貓 2020-07-29 14:47:49 +08:00
parent aa35e45426
commit 5c2f5a0407

View File

@ -330,7 +330,7 @@ def fill_transaction_from_form(transaction, form):
if F"{rec_type}-{no}-sn" in form:
record.pk = form[F"{rec_type}-{no}-sn"]
if F"{rec_type}-{no}-account" in form:
record.account = Account(pk=form[F"{rec_type}-{no}-account"])
record.account = Account(code=form[F"{rec_type}-{no}-account"])
if F"{rec_type}-{no}-summary" in form:
record.summary = form[F"{rec_type}-{no}-summary"]
if F"{rec_type}-{no}-amount" in form: