fix(ux): throw if no row selected to create repost entries

This commit is contained in:
s-aga-r 2023-05-31 15:30:45 +05:30
parent bb21c044f6
commit 1905239ec2

View File

@ -53,11 +53,14 @@ frappe.query_reports["Stock and Account Value Comparison"] = {
<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: {