Reload sales taxes and charges in patch
diff --git a/erpnext/patches/v4_0/update_tax_amount_after_discount.py b/erpnext/patches/v4_0/update_tax_amount_after_discount.py
index 37f082b..e935bc4 100644
--- a/erpnext/patches/v4_0/update_tax_amount_after_discount.py
+++ b/erpnext/patches/v4_0/update_tax_amount_after_discount.py
@@ -5,6 +5,7 @@
import frappe
def execute():
+ frappe.reload_doc("accounts", "doctype", "sales_taxes_and_charges")
docs_with_discount_amount = frappe._dict()
for dt in ["Quotation", "Sales Order", "Delivery Note", "Sales Invoice"]:
records = frappe.db.sql_list("""select name from `tab%s`