Merge pull request #40936 from ruthra-kumar/ignore_dimension_validation_on_pl
fix: ignore dimension validation for cancelled entries
diff --git a/erpnext/accounts/doctype/gl_entry/gl_entry.py b/erpnext/accounts/doctype/gl_entry/gl_entry.py
index c494eec..d74224c 100644
--- a/erpnext/accounts/doctype/gl_entry/gl_entry.py
+++ b/erpnext/accounts/doctype/gl_entry/gl_entry.py
@@ -182,6 +182,7 @@
and self.company == dimension.company
and dimension.mandatory_for_pl
and not dimension.disabled
+ and not self.is_cancelled
):
if not self.get(dimension.fieldname):
frappe.throw(
@@ -195,6 +196,7 @@
and self.company == dimension.company
and dimension.mandatory_for_bs
and not dimension.disabled
+ and not self.is_cancelled
):
if not self.get(dimension.fieldname):
frappe.throw(