Merge pull request #36881 from deepeshgarg007/patch_revert

chore: remove patch
diff --git a/erpnext/accounts/report/purchase_register/purchase_register.py b/erpnext/accounts/report/purchase_register/purchase_register.py
index c7b7e2f..ca8b9f0 100644
--- a/erpnext/accounts/report/purchase_register/purchase_register.py
+++ b/erpnext/accounts/report/purchase_register/purchase_register.py
@@ -10,8 +10,8 @@
 
 from erpnext.accounts.party import get_party_account
 from erpnext.accounts.report.utils import (
+	apply_common_conditions,
 	get_advance_taxes_and_charges,
-	get_conditions,
 	get_journal_entries,
 	get_opening_row,
 	get_party_details,
@@ -378,11 +378,8 @@
 
 def get_invoices(filters, additional_query_columns):
 	pi = frappe.qb.DocType("Purchase Invoice")
-	invoice_item = frappe.qb.DocType("Purchase Invoice Item")
 	query = (
 		frappe.qb.from_(pi)
-		.inner_join(invoice_item)
-		.on(pi.name == invoice_item.parent)
 		.select(
 			ConstantColumn("Purchase Invoice").as_("doctype"),
 			pi.name,
@@ -402,23 +399,39 @@
 		.where((pi.docstatus == 1))
 		.orderby(pi.posting_date, pi.name, order=Order.desc)
 	)
+
 	if additional_query_columns:
 		for col in additional_query_columns:
 			query = query.select(col)
+
 	if filters.get("supplier"):
 		query = query.where(pi.supplier == filters.supplier)
-	query = get_conditions(
+
+	query = get_conditions(filters, query, "Purchase Invoice")
+
+	query = apply_common_conditions(
 		filters, query, doctype="Purchase Invoice", child_doctype="Purchase Invoice Item"
 	)
+
 	if filters.get("include_payments"):
 		party_account = get_party_account(
 			"Supplier", filters.get("supplier"), filters.get("company"), include_advance=True
 		)
 		query = query.where(pi.credit_to.isin(party_account))
+
 	invoices = query.run(as_dict=True)
 	return invoices
 
 
+def get_conditions(filters, query, doctype):
+	parent_doc = frappe.qb.DocType(doctype)
+
+	if filters.get("mode_of_payment"):
+		query = query.where(parent_doc.mode_of_payment == filters.mode_of_payment)
+
+	return query
+
+
 def get_payments(filters):
 	args = frappe._dict(
 		account="credit_to",
diff --git a/erpnext/accounts/report/sales_register/sales_register.py b/erpnext/accounts/report/sales_register/sales_register.py
index 35d8d16..d3fc373 100644
--- a/erpnext/accounts/report/sales_register/sales_register.py
+++ b/erpnext/accounts/report/sales_register/sales_register.py
@@ -11,8 +11,8 @@
 
 from erpnext.accounts.party import get_party_account
 from erpnext.accounts.report.utils import (
+	apply_common_conditions,
 	get_advance_taxes_and_charges,
-	get_conditions,
 	get_journal_entries,
 	get_opening_row,
 	get_party_details,
@@ -415,14 +415,8 @@
 
 def get_invoices(filters, additional_query_columns):
 	si = frappe.qb.DocType("Sales Invoice")
-	invoice_item = frappe.qb.DocType("Sales Invoice Item")
-	invoice_payment = frappe.qb.DocType("Sales Invoice Payment")
 	query = (
 		frappe.qb.from_(si)
-		.inner_join(invoice_item)
-		.on(si.name == invoice_item.parent)
-		.left_join(invoice_payment)
-		.on(si.name == invoice_payment.parent)
 		.select(
 			ConstantColumn("Sales Invoice").as_("doctype"),
 			si.name,
@@ -447,18 +441,36 @@
 		.where((si.docstatus == 1))
 		.orderby(si.posting_date, si.name, order=Order.desc)
 	)
+
 	if additional_query_columns:
 		for col in additional_query_columns:
 			query = query.select(col)
+
 	if filters.get("customer"):
 		query = query.where(si.customer == filters.customer)
-	query = get_conditions(
+
+	query = get_conditions(filters, query, "Sales Invoice")
+	query = apply_common_conditions(
 		filters, query, doctype="Sales Invoice", child_doctype="Sales Invoice Item"
 	)
+
 	invoices = query.run(as_dict=True)
 	return invoices
 
 
+def get_conditions(filters, query, doctype):
+	parent_doc = frappe.qb.DocType(doctype)
+	if filters.get("owner"):
+		query = query.where(parent_doc.owner == filters.owner)
+
+	if filters.get("mode_of_payment"):
+		payment_doc = frappe.qb.DocType("Sales Invoice Payment")
+		query = query.inner_join(payment_doc).on(parent_doc.name == payment_doc.parent)
+		query = query.where(payment_doc.mode_of_payment == filters.mode_of_payment).distinct()
+
+	return query
+
+
 def get_payments(filters):
 	args = frappe._dict(
 		account="debit_to",
diff --git a/erpnext/accounts/report/utils.py b/erpnext/accounts/report/utils.py
index 0753fff..9f96449 100644
--- a/erpnext/accounts/report/utils.py
+++ b/erpnext/accounts/report/utils.py
@@ -256,7 +256,8 @@
 		)
 		.orderby(je.posting_date, je.name, order=Order.desc)
 	)
-	query = get_conditions(filters, query, doctype="Journal Entry", payments=True)
+	query = apply_common_conditions(filters, query, doctype="Journal Entry", payments=True)
+
 	journal_entries = query.run(as_dict=True)
 	return journal_entries
 
@@ -284,28 +285,17 @@
 		)
 		.orderby(pe.posting_date, pe.name, order=Order.desc)
 	)
-	query = get_conditions(filters, query, doctype="Payment Entry", payments=True)
+	query = apply_common_conditions(filters, query, doctype="Payment Entry", payments=True)
 	payment_entries = query.run(as_dict=True)
 	return payment_entries
 
 
-def get_conditions(filters, query, doctype, child_doctype=None, payments=False):
+def apply_common_conditions(filters, query, doctype, child_doctype=None, payments=False):
 	parent_doc = frappe.qb.DocType(doctype)
 	if child_doctype:
 		child_doc = frappe.qb.DocType(child_doctype)
 
-	if parent_doc.get_table_name() == "tabSales Invoice":
-		if filters.get("owner"):
-			query = query.where(parent_doc.owner == filters.owner)
-		if filters.get("mode_of_payment"):
-			payment_doc = frappe.qb.DocType("Sales Invoice Payment")
-			query = query.where(payment_doc.mode_of_payment == filters.mode_of_payment)
-		if not payments:
-			if filters.get("brand"):
-				query = query.where(child_doc.brand == filters.brand)
-	else:
-		if filters.get("mode_of_payment"):
-			query = query.where(parent_doc.mode_of_payment == filters.mode_of_payment)
+	join_required = False
 
 	if filters.get("company"):
 		query = query.where(parent_doc.company == filters.company)
@@ -320,13 +310,26 @@
 	else:
 		if filters.get("cost_center"):
 			query = query.where(child_doc.cost_center == filters.cost_center)
+			join_required = True
 		if filters.get("warehouse"):
 			query = query.where(child_doc.warehouse == filters.warehouse)
+			join_required = True
 		if filters.get("item_group"):
 			query = query.where(child_doc.item_group == filters.item_group)
+			join_required = True
+
+	if not payments:
+		if filters.get("brand"):
+			query = query.where(child_doc.brand == filters.brand)
+			join_required = True
+
+	if join_required:
+		query = query.inner_join(child_doc).on(parent_doc.name == child_doc.parent)
+		query = query.distinct()
 
 	if parent_doc.get_table_name() != "tabJournal Entry":
 		query = filter_invoices_based_on_dimensions(filters, query, parent_doc)
+
 	return query
 
 
diff --git a/erpnext/assets/doctype/location/location.json b/erpnext/assets/doctype/location/location.json
index f56fd05..9202fb9 100644
--- a/erpnext/assets/doctype/location/location.json
+++ b/erpnext/assets/doctype/location/location.json
@@ -39,6 +39,7 @@
   {
    "fieldname": "parent_location",
    "fieldtype": "Link",
+   "ignore_user_permissions": 1,
    "label": "Parent Location",
    "options": "Location",
    "search_index": 1
@@ -141,11 +142,11 @@
  ],
  "is_tree": 1,
  "links": [],
- "modified": "2020-05-08 16:11:11.375701",
+ "modified": "2023-08-29 12:49:33.290527",
  "modified_by": "Administrator",
  "module": "Assets",
  "name": "Location",
- "name_case": "Title Case",
+ "naming_rule": "By fieldname",
  "nsm_parent_field": "parent_location",
  "owner": "Administrator",
  "permissions": [
@@ -224,5 +225,6 @@
  "show_name_in_global_search": 1,
  "sort_field": "modified",
  "sort_order": "DESC",
+ "states": [],
  "track_changes": 1
 }
\ No newline at end of file
diff --git a/erpnext/crm/doctype/lead/lead.json b/erpnext/crm/doctype/lead/lead.json
index 0cb8824..dafbd9f 100644
--- a/erpnext/crm/doctype/lead/lead.json
+++ b/erpnext/crm/doctype/lead/lead.json
@@ -516,7 +516,7 @@
  "idx": 5,
  "image_field": "image",
  "links": [],
- "modified": "2023-04-14 18:20:05.044791",
+ "modified": "2023-08-28 22:28:00.104413",
  "modified_by": "Administrator",
  "module": "CRM",
  "name": "Lead",
@@ -527,7 +527,7 @@
    "permlevel": 1,
    "read": 1,
    "report": 1,
-   "role": "All"
+   "role": "Desk User"
   },
   {
    "create": 1,
@@ -583,4 +583,4 @@
  "states": [],
  "subject_field": "title",
  "title_field": "title"
-}
+}
\ No newline at end of file
diff --git a/erpnext/projects/doctype/project/project.json b/erpnext/projects/doctype/project/project.json
index 502ee57..715b09c 100644
--- a/erpnext/projects/doctype/project/project.json
+++ b/erpnext/projects/doctype/project/project.json
@@ -453,7 +453,7 @@
  "index_web_pages_for_search": 1,
  "links": [],
  "max_attachments": 4,
- "modified": "2023-06-28 18:57:11.603497",
+ "modified": "2023-08-28 22:27:28.370849",
  "modified_by": "Administrator",
  "module": "Projects",
  "name": "Project",
@@ -475,7 +475,7 @@
    "permlevel": 1,
    "read": 1,
    "report": 1,
-   "role": "All"
+   "role": "Desk User"
   },
   {
    "create": 1,
diff --git a/erpnext/quality_management/doctype/quality_action/quality_action.json b/erpnext/quality_management/doctype/quality_action/quality_action.json
index 0cc2a98..f0b33b9 100644
--- a/erpnext/quality_management/doctype/quality_action/quality_action.json
+++ b/erpnext/quality_management/doctype/quality_action/quality_action.json
@@ -91,7 +91,7 @@
  ],
  "index_web_pages_for_search": 1,
  "links": [],
- "modified": "2020-10-27 16:21:59.533937",
+ "modified": "2023-08-28 22:33:14.358143",
  "modified_by": "Administrator",
  "module": "Quality Management",
  "name": "Quality Action",
@@ -117,12 +117,13 @@
    "print": 1,
    "read": 1,
    "report": 1,
-   "role": "All",
+   "role": "Desk User",
    "share": 1,
    "write": 1
   }
  ],
  "sort_field": "modified",
  "sort_order": "DESC",
+ "states": [],
  "track_changes": 1
 }
\ No newline at end of file
diff --git a/erpnext/quality_management/doctype/quality_feedback/quality_feedback.json b/erpnext/quality_management/doctype/quality_feedback/quality_feedback.json
index f3bd0dd..5fe6375 100644
--- a/erpnext/quality_management/doctype/quality_feedback/quality_feedback.json
+++ b/erpnext/quality_management/doctype/quality_feedback/quality_feedback.json
@@ -61,7 +61,7 @@
    "link_fieldname": "feedback"
   }
  ],
- "modified": "2020-10-27 16:20:10.918544",
+ "modified": "2023-08-28 22:21:36.144820",
  "modified_by": "Administrator",
  "module": "Quality Management",
  "name": "Quality Feedback",
@@ -87,12 +87,13 @@
    "print": 1,
    "read": 1,
    "report": 1,
-   "role": "All",
+   "role": "Desk User",
    "share": 1,
    "write": 1
   }
  ],
  "sort_field": "modified",
  "sort_order": "DESC",
+ "states": [],
  "track_changes": 1
 }
\ No newline at end of file
diff --git a/erpnext/quality_management/doctype/quality_goal/quality_goal.json b/erpnext/quality_management/doctype/quality_goal/quality_goal.json
index 2680255..f2b6ebc 100644
--- a/erpnext/quality_management/doctype/quality_goal/quality_goal.json
+++ b/erpnext/quality_management/doctype/quality_goal/quality_goal.json
@@ -76,7 +76,7 @@
    "link_fieldname": "goal"
   }
  ],
- "modified": "2020-10-27 15:57:59.368605",
+ "modified": "2023-08-28 22:33:27.718899",
  "modified_by": "Administrator",
  "module": "Quality Management",
  "name": "Quality Goal",
@@ -102,12 +102,13 @@
    "print": 1,
    "read": 1,
    "report": 1,
-   "role": "All",
+   "role": "Desk User",
    "share": 1,
    "write": 1
   }
  ],
  "sort_field": "modified",
  "sort_order": "DESC",
+ "states": [],
  "track_changes": 1
 }
\ No newline at end of file
diff --git a/erpnext/quality_management/doctype/quality_meeting/quality_meeting.json b/erpnext/quality_management/doctype/quality_meeting/quality_meeting.json
index e2125c3..7ab28d8 100644
--- a/erpnext/quality_management/doctype/quality_meeting/quality_meeting.json
+++ b/erpnext/quality_management/doctype/quality_meeting/quality_meeting.json
@@ -48,7 +48,7 @@
  ],
  "index_web_pages_for_search": 1,
  "links": [],
- "modified": "2021-02-27 16:36:45.657883",
+ "modified": "2023-08-28 22:33:57.447634",
  "modified_by": "Administrator",
  "module": "Quality Management",
  "name": "Quality Meeting",
@@ -74,7 +74,7 @@
    "print": 1,
    "read": 1,
    "report": 1,
-   "role": "All",
+   "role": "Desk User",
    "share": 1,
    "write": 1
   }
@@ -82,5 +82,6 @@
  "quick_entry": 1,
  "sort_field": "modified",
  "sort_order": "DESC",
+ "states": [],
  "track_changes": 1
-}
+}
\ No newline at end of file
diff --git a/erpnext/quality_management/doctype/quality_procedure/quality_procedure.json b/erpnext/quality_management/doctype/quality_procedure/quality_procedure.json
index f588f9a..fd5a595 100644
--- a/erpnext/quality_management/doctype/quality_procedure/quality_procedure.json
+++ b/erpnext/quality_management/doctype/quality_procedure/quality_procedure.json
@@ -23,6 +23,7 @@
   {
    "fieldname": "parent_quality_procedure",
    "fieldtype": "Link",
+   "ignore_user_permissions": 1,
    "label": "Parent Procedure",
    "options": "Quality Procedure"
   },
@@ -115,7 +116,7 @@
    "link_fieldname": "procedure"
   }
  ],
- "modified": "2020-10-26 15:25:39.316088",
+ "modified": "2023-08-28 22:33:36.483420",
  "modified_by": "Administrator",
  "module": "Quality Management",
  "name": "Quality Procedure",
@@ -142,12 +143,13 @@
    "print": 1,
    "read": 1,
    "report": 1,
-   "role": "All",
+   "role": "Desk User",
    "share": 1,
    "write": 1
   }
  ],
  "sort_field": "modified",
  "sort_order": "DESC",
+ "states": [],
  "track_changes": 1
 }
\ No newline at end of file
diff --git a/erpnext/quality_management/doctype/quality_review/quality_review.json b/erpnext/quality_management/doctype/quality_review/quality_review.json
index 31ad341..f38e8a5 100644
--- a/erpnext/quality_management/doctype/quality_review/quality_review.json
+++ b/erpnext/quality_management/doctype/quality_review/quality_review.json
@@ -84,7 +84,7 @@
    "link_fieldname": "review"
   }
  ],
- "modified": "2020-10-21 12:56:47.046172",
+ "modified": "2023-08-28 22:33:22.472980",
  "modified_by": "Administrator",
  "module": "Quality Management",
  "name": "Quality Review",
@@ -110,7 +110,7 @@
    "print": 1,
    "read": 1,
    "report": 1,
-   "role": "All",
+   "role": "Desk User",
    "share": 1,
    "write": 1
   },
@@ -129,6 +129,7 @@
  ],
  "sort_field": "modified",
  "sort_order": "DESC",
+ "states": [],
  "title_field": "goal",
  "track_changes": 1
 }
\ No newline at end of file
diff --git a/erpnext/setup/doctype/department/department.json b/erpnext/setup/doctype/department/department.json
index 5a16bae..99deca5 100644
--- a/erpnext/setup/doctype/department/department.json
+++ b/erpnext/setup/doctype/department/department.json
@@ -25,18 +25,15 @@
    "label": "Department",
    "oldfieldname": "department_name",
    "oldfieldtype": "Data",
-   "reqd": 1,
-   "show_days": 1,
-   "show_seconds": 1
+   "reqd": 1
   },
   {
    "fieldname": "parent_department",
    "fieldtype": "Link",
+   "ignore_user_permissions": 1,
    "in_list_view": 1,
    "label": "Parent Department",
-   "options": "Department",
-   "show_days": 1,
-   "show_seconds": 1
+   "options": "Department"
   },
   {
    "fieldname": "company",
@@ -44,9 +41,7 @@
    "in_standard_filter": 1,
    "label": "Company",
    "options": "Company",
-   "reqd": 1,
-   "show_days": 1,
-   "show_seconds": 1
+   "reqd": 1
   },
   {
    "bold": 1,
@@ -54,17 +49,13 @@
    "fieldname": "is_group",
    "fieldtype": "Check",
    "in_list_view": 1,
-   "label": "Is Group",
-   "show_days": 1,
-   "show_seconds": 1
+   "label": "Is Group"
   },
   {
    "default": "0",
    "fieldname": "disabled",
    "fieldtype": "Check",
-   "label": "Disabled",
-   "show_days": 1,
-   "show_seconds": 1
+   "label": "Disabled"
   },
   {
    "fieldname": "lft",
@@ -72,9 +63,7 @@
    "hidden": 1,
    "label": "lft",
    "print_hide": 1,
-   "read_only": 1,
-   "show_days": 1,
-   "show_seconds": 1
+   "read_only": 1
   },
   {
    "fieldname": "rgt",
@@ -82,9 +71,7 @@
    "hidden": 1,
    "label": "rgt",
    "print_hide": 1,
-   "read_only": 1,
-   "show_days": 1,
-   "show_seconds": 1
+   "read_only": 1
   },
   {
    "fieldname": "old_parent",
@@ -92,22 +79,18 @@
    "hidden": 1,
    "ignore_user_permissions": 1,
    "label": "Old Parent",
-   "print_hide": 1,
-   "show_days": 1,
-   "show_seconds": 1
+   "print_hide": 1
   },
   {
    "fieldname": "column_break_3",
-   "fieldtype": "Column Break",
-   "show_days": 1,
-   "show_seconds": 1
+   "fieldtype": "Column Break"
   }
  ],
  "icon": "fa fa-sitemap",
  "idx": 1,
  "is_tree": 1,
  "links": [],
- "modified": "2020-06-10 12:28:00.563272",
+ "modified": "2023-08-28 17:26:46.826501",
  "modified_by": "Administrator",
  "module": "Setup",
  "name": "Department",
@@ -147,12 +130,12 @@
    "read": 1,
    "report": 1,
    "role": "HR Manager",
-   "set_user_permissions": 1,
    "share": 1,
    "write": 1
   }
  ],
  "show_name_in_global_search": 1,
  "sort_field": "modified",
- "sort_order": "ASC"
+ "sort_order": "ASC",
+ "states": []
 }
\ No newline at end of file
diff --git a/erpnext/setup/doctype/item_group/item_group.json b/erpnext/setup/doctype/item_group/item_group.json
index 2986087..e0f5090 100644
--- a/erpnext/setup/doctype/item_group/item_group.json
+++ b/erpnext/setup/doctype/item_group/item_group.json
@@ -233,7 +233,7 @@
  "is_tree": 1,
  "links": [],
  "max_attachments": 3,
- "modified": "2023-01-05 12:21:30.458628",
+ "modified": "2023-08-28 22:27:48.382985",
  "modified_by": "Administrator",
  "module": "Setup",
  "name": "Item Group",
@@ -266,7 +266,6 @@
    "read": 1,
    "report": 1,
    "role": "Item Manager",
-   "set_user_permissions": 1,
    "share": 1,
    "write": 1
   },
@@ -296,7 +295,7 @@
    "export": 1,
    "print": 1,
    "report": 1,
-   "role": "All",
+   "role": "Desk User",
    "select": 1,
    "share": 1
   }
diff --git a/erpnext/setup/doctype/print_heading/print_heading.json b/erpnext/setup/doctype/print_heading/print_heading.json
index dc07f0c..1083583 100644
--- a/erpnext/setup/doctype/print_heading/print_heading.json
+++ b/erpnext/setup/doctype/print_heading/print_heading.json
@@ -1,131 +1,68 @@
 {
- "allow_copy": 0, 
- "allow_import": 1, 
- "allow_rename": 1, 
- "autoname": "field:print_heading", 
- "beta": 0, 
- "creation": "2013-01-10 16:34:24", 
- "custom": 0, 
- "docstatus": 0, 
- "doctype": "DocType", 
- "document_type": "Setup", 
- "editable_grid": 0, 
+ "actions": [],
+ "allow_import": 1,
+ "allow_rename": 1,
+ "autoname": "field:print_heading",
+ "creation": "2013-01-10 16:34:24",
+ "doctype": "DocType",
+ "document_type": "Setup",
+ "engine": "InnoDB",
+ "field_order": [
+  "print_heading",
+  "description"
+ ],
  "fields": [
   {
-   "allow_on_submit": 1, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "fieldname": "print_heading", 
-   "fieldtype": "Data", 
-   "hidden": 0, 
-   "ignore_user_permissions": 0, 
-   "ignore_xss_filter": 0, 
-   "in_filter": 1, 
-   "in_list_view": 1, 
-   "label": "Print Heading", 
-   "length": 0, 
-   "no_copy": 0, 
-   "oldfieldname": "print_heading", 
-   "oldfieldtype": "Data", 
-   "permlevel": 0, 
-   "print_hide": 0, 
-   "print_hide_if_no_value": 0, 
-   "read_only": 0, 
-   "report_hide": 0, 
-   "reqd": 1, 
-   "search_index": 0, 
-   "set_only_once": 0, 
-   "unique": 0
-  }, 
+   "allow_on_submit": 1,
+   "fieldname": "print_heading",
+   "fieldtype": "Data",
+   "in_filter": 1,
+   "in_list_view": 1,
+   "label": "Print Heading",
+   "oldfieldname": "print_heading",
+   "oldfieldtype": "Data",
+   "reqd": 1,
+   "unique": 1
+  },
   {
-   "allow_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "fieldname": "description", 
-   "fieldtype": "Small Text", 
-   "hidden": 0, 
-   "ignore_user_permissions": 0, 
-   "ignore_xss_filter": 0, 
-   "in_filter": 0, 
-   "in_list_view": 1, 
-   "label": "Description", 
-   "length": 0, 
-   "no_copy": 0, 
-   "oldfieldname": "description", 
-   "oldfieldtype": "Small Text", 
-   "permlevel": 0, 
-   "print_hide": 0, 
-   "print_hide_if_no_value": 0, 
-   "read_only": 0, 
-   "report_hide": 0, 
-   "reqd": 0, 
-   "search_index": 0, 
-   "set_only_once": 0, 
-   "unique": 0, 
+   "fieldname": "description",
+   "fieldtype": "Small Text",
+   "in_list_view": 1,
+   "label": "Description",
+   "oldfieldname": "description",
+   "oldfieldtype": "Small Text",
    "width": "300px"
   }
- ], 
- "hide_heading": 0, 
- "hide_toolbar": 0, 
- "icon": "fa fa-font", 
- "idx": 1, 
- "image_view": 0, 
- "in_create": 0, 
-
- "is_submittable": 0, 
- "issingle": 0, 
- "istable": 0, 
- "max_attachments": 0, 
- "modified": "2016-07-25 05:24:25.628101", 
- "modified_by": "Administrator", 
- "module": "Setup", 
- "name": "Print Heading", 
- "owner": "Administrator", 
+ ],
+ "icon": "fa fa-font",
+ "idx": 1,
+ "links": [],
+ "modified": "2023-08-28 22:17:42.041255",
+ "modified_by": "Administrator",
+ "module": "Setup",
+ "name": "Print Heading",
+ "naming_rule": "By fieldname",
+ "owner": "Administrator",
  "permissions": [
   {
-   "amend": 0, 
-   "apply_user_permissions": 0, 
-   "cancel": 0, 
-   "create": 1, 
-   "delete": 1, 
-   "email": 1, 
-   "export": 0, 
-   "if_owner": 0, 
-   "import": 0, 
-   "permlevel": 0, 
-   "print": 1, 
-   "read": 1, 
-   "report": 1, 
-   "role": "System Manager", 
-   "set_user_permissions": 0, 
-   "share": 1, 
-   "submit": 0, 
+   "create": 1,
+   "delete": 1,
+   "email": 1,
+   "print": 1,
+   "read": 1,
+   "report": 1,
+   "role": "System Manager",
+   "share": 1,
    "write": 1
-  }, 
+  },
   {
-   "amend": 0, 
-   "apply_user_permissions": 0, 
-   "cancel": 0, 
-   "create": 0, 
-   "delete": 0, 
-   "email": 0, 
-   "export": 0, 
-   "if_owner": 0, 
-   "import": 0, 
-   "permlevel": 0, 
-   "print": 0, 
-   "read": 1, 
-   "report": 0, 
-   "role": "All", 
-   "set_user_permissions": 0, 
-   "share": 0, 
-   "submit": 0, 
-   "write": 0
+   "read": 1,
+   "role": "Desk User"
   }
- ], 
- "quick_entry": 1, 
- "read_only": 0, 
- "read_only_onload": 0, 
- "search_fields": "print_heading", 
- "track_seen": 0
+ ],
+ "quick_entry": 1,
+ "search_fields": "print_heading",
+ "sort_field": "modified",
+ "sort_order": "DESC",
+ "states": []
 }
\ No newline at end of file
diff --git a/erpnext/stock/doctype/item/item.json b/erpnext/stock/doctype/item/item.json
index 87c2a7e..756d004 100644
--- a/erpnext/stock/doctype/item/item.json
+++ b/erpnext/stock/doctype/item/item.json
@@ -912,7 +912,7 @@
  "index_web_pages_for_search": 1,
  "links": [],
  "make_attachments_public": 1,
- "modified": "2023-07-14 17:18:18.658942",
+ "modified": "2023-08-28 22:16:40.305094",
  "modified_by": "Administrator",
  "module": "Stock",
  "name": "Item",
@@ -971,7 +971,7 @@
    "export": 1,
    "print": 1,
    "report": 1,
-   "role": "All",
+   "role": "Desk User",
    "select": 1,
    "share": 1
   }
diff --git a/erpnext/stock/report/stock_balance/stock_balance.js b/erpnext/stock/report/stock_balance/stock_balance.js
index 33ed955..6de5f00 100644
--- a/erpnext/stock/report/stock_balance/stock_balance.js
+++ b/erpnext/stock/report/stock_balance/stock_balance.js
@@ -72,6 +72,14 @@
 			"options": "Warehouse Type"
 		},
 		{
+			"fieldname": "valuation_field_type",
+			"label": __("Valuation Field Type"),
+			"fieldtype": "Select",
+			"width": "80",
+			"options": "Currency\nFloat",
+			"default": "Currency"
+		},
+		{
 			"fieldname":"include_uom",
 			"label": __("Include UOM"),
 			"fieldtype": "Link",
diff --git a/erpnext/stock/report/stock_balance/stock_balance.py b/erpnext/stock/report/stock_balance/stock_balance.py
index d60e9b5..1dafb4d 100644
--- a/erpnext/stock/report/stock_balance/stock_balance.py
+++ b/erpnext/stock/report/stock_balance/stock_balance.py
@@ -446,9 +446,12 @@
 				{
 					"label": _("Valuation Rate"),
 					"fieldname": "val_rate",
-					"fieldtype": "Float",
+					"fieldtype": self.filters.valuation_field_type or "Currency",
 					"width": 90,
 					"convertible": "rate",
+					"options": "Company:company:default_currency"
+					if self.filters.valuation_field_type == "Currency"
+					else None,
 				},
 				{
 					"label": _("Reserved Stock"),
diff --git a/erpnext/stock/report/stock_ledger/stock_ledger.js b/erpnext/stock/report/stock_ledger/stock_ledger.js
index 0def161..b00b422 100644
--- a/erpnext/stock/report/stock_ledger/stock_ledger.js
+++ b/erpnext/stock/report/stock_ledger/stock_ledger.js
@@ -82,7 +82,15 @@
 			"label": __("Include UOM"),
 			"fieldtype": "Link",
 			"options": "UOM"
-		}
+		},
+		{
+			"fieldname": "valuation_field_type",
+			"label": __("Valuation Field Type"),
+			"fieldtype": "Select",
+			"width": "80",
+			"options": "Currency\nFloat",
+			"default": "Currency"
+		},
 	],
 	"formatter": function (value, row, column, data, default_formatter) {
 		value = default_formatter(value, row, column, data);
diff --git a/erpnext/stock/report/stock_ledger/stock_ledger.py b/erpnext/stock/report/stock_ledger/stock_ledger.py
index ed28ed3..eeef396 100644
--- a/erpnext/stock/report/stock_ledger/stock_ledger.py
+++ b/erpnext/stock/report/stock_ledger/stock_ledger.py
@@ -196,17 +196,21 @@
 			{
 				"label": _("Avg Rate (Balance Stock)"),
 				"fieldname": "valuation_rate",
-				"fieldtype": "Float",
+				"fieldtype": filters.valuation_field_type,
 				"width": 180,
-				"options": "Company:company:default_currency",
+				"options": "Company:company:default_currency"
+				if filters.valuation_field_type == "Currency"
+				else None,
 				"convertible": "rate",
 			},
 			{
 				"label": _("Valuation Rate"),
 				"fieldname": "in_out_rate",
-				"fieldtype": "Float",
+				"fieldtype": filters.valuation_field_type,
 				"width": 140,
-				"options": "Company:company:default_currency",
+				"options": "Company:company:default_currency"
+				if filters.valuation_field_type == "Currency"
+				else None,
 				"convertible": "rate",
 			},
 			{
diff --git a/erpnext/support/doctype/service_level_agreement/service_level_agreement.json b/erpnext/support/doctype/service_level_agreement/service_level_agreement.json
index 1c6f24b..5882033 100644
--- a/erpnext/support/doctype/service_level_agreement/service_level_agreement.json
+++ b/erpnext/support/doctype/service_level_agreement/service_level_agreement.json
@@ -192,7 +192,7 @@
   }
  ],
  "links": [],
- "modified": "2023-04-21 17:16:56.192560",
+ "modified": "2023-08-28 22:17:54.740924",
  "modified_by": "Administrator",
  "module": "Support",
  "name": "Service Level Agreement",
@@ -213,7 +213,7 @@
   },
   {
    "read": 1,
-   "role": "All"
+   "role": "Desk User"
   }
  ],
  "sort_field": "modified",