Merge pull request #35503 from s-aga-r/FIX-ISS-23-24-01158
fix(ux): throw if no row selected to create repost entries
diff --git a/erpnext/stock/report/stock_and_account_value_comparison/stock_and_account_value_comparison.js b/erpnext/stock/report/stock_and_account_value_comparison/stock_and_account_value_comparison.js
index 50a78a8..254f527 100644
--- a/erpnext/stock/report/stock_and_account_value_comparison/stock_and_account_value_comparison.js
+++ b/erpnext/stock/report/stock_and_account_value_comparison/stock_and_account_value_comparison.js
@@ -53,11 +53,14 @@
<p>Are you sure you want to create Reposting Entries?</p>
</div>
`;
+ let indexes = frappe.query_report.datatable.rowmanager.getCheckedRows();
+ let selected_rows = indexes.map(i => frappe.query_report.data[i]);
+
+ if (!selected_rows.length) {
+ frappe.throw(__("Please select rows to create Reposting Entries"));
+ }
frappe.confirm(__(message), () => {
- let indexes = frappe.query_report.datatable.rowmanager.getCheckedRows();
- let selected_rows = indexes.map(i => frappe.query_report.data[i]);
-
frappe.call({
method: "erpnext.stock.report.stock_and_account_value_comparison.stock_and_account_value_comparison.create_reposting_entries",
args: {