Merge pull request #16155 from rohitwaghchaure/changed_parent_for_item_attribute_value

[Fix] Permissions issue
diff --git a/erpnext/education/doctype/assessment_result/assessment_result.js b/erpnext/education/doctype/assessment_result/assessment_result.js
index cf176aa..27f5490 100644
--- a/erpnext/education/doctype/assessment_result/assessment_result.js
+++ b/erpnext/education/doctype/assessment_result/assessment_result.js
@@ -50,6 +50,12 @@
 frappe.ui.form.on("Assessment Result Detail", {
 	score: function(frm, cdt, cdn) {
 		var d  = locals[cdt][cdn];
+
+		if(!d.maximum_score || !frm.doc.grading_scale) {
+			d.score = "";
+			frappe.throw(__("Please fill in all the details to generate Assessment Result."));
+		}
+
 		if (d.score > d.maximum_score) {
 			frappe.throw(__("Score cannot be greater than Maximum Score"));
 		}
diff --git a/erpnext/stock/doctype/item/item.js b/erpnext/stock/doctype/item/item.js
index 86594a2..3bebd29 100644
--- a/erpnext/stock/doctype/item/item.js
+++ b/erpnext/stock/doctype/item/item.js
@@ -458,7 +458,7 @@
 						fields: ["attribute_value"],
 						limit_start: 0,
 						limit_page_length: 500,
-						parent: "Item"
+						parent: "Item Attribute"
 					}
 				}).then((r) => {
 					if(r.message) {
@@ -579,7 +579,7 @@
 								["attribute_value", "like", term + "%"]
 							],
 							fields: ["attribute_value"],
-							parent: "Item"
+							parent: "Item Attribute"
 						},
 						callback: function(r) {
 							if (r.message) {
diff --git a/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.py b/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.py
index 5b6e706..257434f 100644
--- a/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.py
+++ b/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.py
@@ -180,7 +180,7 @@
 				frappe.throw(_("Valuation Rate required for Item in row {0}").format(row.idx))
 
 			if ((previous_sle and row.qty == previous_sle.get("qty_after_transaction")
-				and row.valuation_rate == previous_sle.get("valuation_rate"))
+				and (row.valuation_rate == previous_sle.get("valuation_rate") or row.qty == 0))
 				or (not previous_sle and not row.qty)):
 					continue
 
diff --git a/erpnext/stock/stock_ledger.py b/erpnext/stock/stock_ledger.py
index 43140fa..c73cbf2 100644
--- a/erpnext/stock/stock_ledger.py
+++ b/erpnext/stock/stock_ledger.py
@@ -176,7 +176,7 @@
 		# rounding as per precision
 		self.stock_value = flt(self.stock_value, self.precision)
 
-		if self.prev_stock_value < 0 and self.stock_value >= 0:
+		if self.prev_stock_value < 0 and self.stock_value >= 0 and sle.voucher_type != 'Stock Reconciliation':
 			stock_value_difference = sle.actual_qty * self.valuation_rate
 		else:
 			stock_value_difference = self.stock_value - self.prev_stock_value