Merge pull request #40973 from ruthra-kumar/fix_link_error_on_dunning_cancellation

fix: Link Validation Error on Dunning cancellation
diff --git a/erpnext/accounts/doctype/dunning/dunning.py b/erpnext/accounts/doctype/dunning/dunning.py
index f7c4d90..260ede5 100644
--- a/erpnext/accounts/doctype/dunning/dunning.py
+++ b/erpnext/accounts/doctype/dunning/dunning.py
@@ -146,6 +146,10 @@
 			)
 			row.dunning_level = len(past_dunnings) + 1
 
+	def on_cancel(self):
+		super().on_cancel()
+		self.ignore_linked_doctypes = ["GL Entry"]
+
 
 def resolve_dunning(doc, state):
 	"""