Skip to content

Commit 9a4c776

Browse files
Merge pull request #53327 from Nihantra-Patel/fix-journal-entry-ignore-linked-doctypes
fix: Append existing ignored doctypes in Journal Entry on_cancel instead of overwriting
2 parents f1ac037 + 39e10c4 commit 9a4c776

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

erpnext/accounts/doctype/journal_entry/journal_entry.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,8 @@ def on_cancel(self):
294294

295295
# References for this Journal are removed on the `on_cancel` event in accounts_controller
296296
super().on_cancel()
297+
298+
from_doc_events = getattr(self, "ignore_linked_doctypes", ())
297299
self.ignore_linked_doctypes = (
298300
"GL Entry",
299301
"Stock Ledger Entry",
@@ -307,6 +309,10 @@ def on_cancel(self):
307309
"Advance Payment Ledger Entry",
308310
"Tax Withholding Entry",
309311
)
312+
313+
if from_doc_events and from_doc_events != self.ignore_linked_doctypes:
314+
self.ignore_linked_doctypes = self.ignore_linked_doctypes + from_doc_events
315+
310316
self.make_gl_entries(1)
311317
JournalTaxWithholding(self).on_cancel()
312318
self.unlink_advance_entry_reference()

0 commit comments

Comments
 (0)