Merge pull request #40741 from rohitwaghchaure/fixed-sales-purchase-return-validation-issue

fix: sales / purchase return validation issue
diff --git a/erpnext/buying/doctype/supplier_quotation/supplier_quotation.json b/erpnext/buying/doctype/supplier_quotation/supplier_quotation.json
index 7d98190..210c730 100644
--- a/erpnext/buying/doctype/supplier_quotation/supplier_quotation.json
+++ b/erpnext/buying/doctype/supplier_quotation/supplier_quotation.json
@@ -462,7 +462,7 @@
   },
   {
    "fieldname": "other_charges_calculation",
-   "fieldtype": "Markdown Editor",
+   "fieldtype": "Text Editor",
    "label": "Taxes and Charges Calculation",
    "no_copy": 1,
    "oldfieldtype": "HTML",
@@ -928,7 +928,7 @@
  "index_web_pages_for_search": 1,
  "is_submittable": 1,
  "links": [],
- "modified": "2024-03-27 13:10:49.116641",
+ "modified": "2024-03-28 10:20:30.231915",
  "modified_by": "Administrator",
  "module": "Buying",
  "name": "Supplier Quotation",
diff --git a/erpnext/buying/doctype/supplier_quotation/supplier_quotation.py b/erpnext/buying/doctype/supplier_quotation/supplier_quotation.py
index 456ed8e..0829b27 100644
--- a/erpnext/buying/doctype/supplier_quotation/supplier_quotation.py
+++ b/erpnext/buying/doctype/supplier_quotation/supplier_quotation.py
@@ -71,7 +71,7 @@
 		naming_series: DF.Literal["PUR-SQTN-.YYYY.-"]
 		net_total: DF.Currency
 		opportunity: DF.Link | None
-		other_charges_calculation: DF.MarkdownEditor | None
+		other_charges_calculation: DF.TextEditor | None
 		plc_conversion_rate: DF.Float
 		price_list_currency: DF.Link | None
 		pricing_rules: DF.Table[PricingRuleDetail]
diff --git a/erpnext/setup/doctype/transaction_deletion_record/transaction_deletion_record.py b/erpnext/setup/doctype/transaction_deletion_record/transaction_deletion_record.py
index 18e4c7d..c9c3c83 100644
--- a/erpnext/setup/doctype/transaction_deletion_record/transaction_deletion_record.py
+++ b/erpnext/setup/doctype/transaction_deletion_record/transaction_deletion_record.py
@@ -414,17 +414,11 @@
 			frappe.delete_doc("Communication", batch, ignore_permissions=True)
 
 	def delete_comments(self, doctype, reference_doc_names):
-		comments = frappe.get_all(
-			"Comment",
-			filters={"reference_doctype": doctype, "reference_name": ["in", reference_doc_names]},
-		)
-		comment_names = [c.name for c in comments]
-
-		if not comment_names:
-			return
-
-		for batch in create_batch(comment_names, self.batch_size):
-			frappe.delete_doc("Comment", batch, ignore_permissions=True)
+		if reference_doc_names:
+			comment = qb.DocType("Comment")
+			qb.from_(comment).delete().where(
+				(comment.reference_doctype == doctype) & (comment.reference_name.isin(reference_doc_names))
+			).run()
 
 	def unlink_attachments(self, doctype, reference_doc_names):
 		files = frappe.get_all(