fix: Add flag for reverse depreciation entries
diff --git a/erpnext/accounts/doctype/gl_entry/gl_entry.py b/erpnext/accounts/doctype/gl_entry/gl_entry.py
index 1e983b1..60015f6 100644
--- a/erpnext/accounts/doctype/gl_entry/gl_entry.py
+++ b/erpnext/accounts/doctype/gl_entry/gl_entry.py
@@ -58,7 +58,8 @@
 
 			# Update outstanding amt on against voucher
 			if (self.against_voucher_type in ['Journal Entry', 'Sales Invoice', 'Purchase Invoice', 'Fees']
-				and self.against_voucher and self.flags.update_outstanding == 'Yes'):
+				and self.against_voucher and self.flags.update_outstanding == 'Yes'
+				and not frappe.flags.is_reverse_depr_entry):
 					update_outstanding_amt(self.account, self.party_type, self.party, self.against_voucher_type,
 						self.against_voucher)
 
diff --git a/erpnext/accounts/doctype/journal_entry/journal_entry.py b/erpnext/accounts/doctype/journal_entry/journal_entry.py
index d04e4a5..f3a0bdb 100644
--- a/erpnext/accounts/doctype/journal_entry/journal_entry.py
+++ b/erpnext/accounts/doctype/journal_entry/journal_entry.py
@@ -58,7 +58,7 @@
 		if not frappe.flags.in_import:
 			self.validate_total_debit_and_credit()
 
-		if not self.flags.is_reverse_depr_entry:
+		if not frappe.flags.is_reverse_depr_entry:
 			self.validate_against_jv()
 			self.validate_stock_accounts()
 
diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice.py b/erpnext/accounts/doctype/sales_invoice/sales_invoice.py
index 1f0b3c2..ef72dec 100644
--- a/erpnext/accounts/doctype/sales_invoice/sales_invoice.py
+++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.py
@@ -1045,7 +1045,7 @@
 
 					reverse_journal_entry = make_reverse_journal_entry(schedule.journal_entry)
 					reverse_journal_entry.posting_date = nowdate()
-					reverse_journal_entry.flags.is_reverse_depr_entry = True
+					frappe.flags.is_reverse_depr_entry = True
 					reverse_journal_entry.submit()
 
 					asset.flags.ignore_validate_update_after_submit = True