From 04fbb725d257b1a6fc279ae2fb0443bf4e55231d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BE=9D=E7=91=AA=E8=B2=93?= Date: Sat, 1 Apr 2023 00:19:32 +0800 Subject: [PATCH] Revised the logic to save the account in the save method of the LineItemSubForm class, since when saving from the line item editor, the account is never null. --- src/accounting/static/js/journal-entry-form.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/accounting/static/js/journal-entry-form.js b/src/accounting/static/js/journal-entry-form.js index 1a56735..de50130 100644 --- a/src/accounting/static/js/journal-entry-form.js +++ b/src/accounting/static/js/journal-entry-form.js @@ -1058,9 +1058,9 @@ class LineItemSubForm { this.#originalLineItemText.classList.remove("d-none"); this.#originalLineItemText.innerText = A_("Offset %(item)s", {item: editor.originalLineItemText}); } - this.#accountCode.value = editor.account === null? "": editor.account.code; - this.#accountCode.dataset.text = editor.account === null? "": editor.account.text; - this.#accountText.innerText = editor.account === null? "": editor.account.text; + this.#accountCode.value = editor.account.code; + this.#accountCode.dataset.text = editor.account.text; + this.#accountText.innerText = editor.account.text; this.#description.value = editor.description === null? "": editor.description; this.#descriptionText.innerText = editor.description === null? "": editor.description; this.#amount.value = editor.amount;