fix: set status on submit/cancel

This commit is contained in:
Nabin Hait
2022-07-20 10:55:10 +05:30
parent 1180135067
commit 04b077a89f
2 changed files with 4 additions and 3 deletions

View File

@@ -19,11 +19,11 @@ class PeriodClosingVoucher(AccountsController):
self.validate_posting_date()
def on_submit(self):
self.gle_processing_status = "In Progress"
self.db_set("gle_processing_status", "In Progress")
self.make_gl_entries()
def on_cancel(self):
self.gle_processing_status = "In Progress"
self.db_set("gle_processing_status", "In Progress")
self.ignore_linked_doctypes = ("GL Entry", "Stock Ledger Entry")
gle_count = frappe.db.count(
"GL Entry",

View File

@@ -59,7 +59,8 @@ class TestPeriodClosingVoucher(unittest.TestCase):
""",
(pcv.name),
)
self.assetEqual(pcv.gle_processing_status, "Completed")
pcv.reload()
self.assertEqual(pcv.gle_processing_status, "Completed")
self.assertEqual(pcv_gle, expected_gle)
def test_cost_center_wise_posting(self):