From 2e2f3f9578240e62846c3e9a6a6938a8b7c9dac8 Mon Sep 17 00:00:00 2001 From: Devin Slauenwhite Date: Mon, 15 Mar 2021 08:27:37 -0400 Subject: [PATCH] fix: stock move dialog duplicate submit actions (#24859) * fix: duplicate submit actions * fix sider errors. --- erpnext/stock/dashboard/item_dashboard.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/erpnext/stock/dashboard/item_dashboard.js b/erpnext/stock/dashboard/item_dashboard.js index 1bfa2cf56c6..97f5494c5f3 100644 --- a/erpnext/stock/dashboard/item_dashboard.js +++ b/erpnext/stock/dashboard/item_dashboard.js @@ -156,7 +156,8 @@ erpnext.stock.move_item = function(item, source, target, actual_qty, rate, callb fieldtype: 'Float', description: __('Available {0}', [actual_qty]) }, {fieldname: 'rate', label: __('Rate'), fieldtype: 'Currency', hidden: 1 }, ], - }) + }); + var submitted = false; dialog.show(); dialog.get_field('item_code').set_input(item); @@ -180,6 +181,7 @@ erpnext.stock.move_item = function(item, source, target, actual_qty, rate, callb } dialog.set_primary_action(__('Submit'), function() { + if(submitted) return; var values = dialog.get_values(); if(!values) { return; @@ -192,6 +194,7 @@ erpnext.stock.move_item = function(item, source, target, actual_qty, rate, callb frappe.msgprint(__('Source and target warehouse must be different')); } + submitted = true; frappe.call({ method: 'erpnext.stock.doctype.stock_entry.stock_entry_utils.make_stock_entry', args: values,