From 042b8524ccb25b0930313fd13fbf2844c2ac5341 Mon Sep 17 00:00:00 2001 From: Ankush Menat Date: Tue, 18 May 2021 16:31:55 +0530 Subject: [PATCH 1/2] fix: disable submit button to avoid multiple calls --- erpnext/stock/dashboard/item_dashboard.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/erpnext/stock/dashboard/item_dashboard.js b/erpnext/stock/dashboard/item_dashboard.js index db0573954f..dfb9e44283 100644 --- a/erpnext/stock/dashboard/item_dashboard.js +++ b/erpnext/stock/dashboard/item_dashboard.js @@ -271,7 +271,9 @@ erpnext.stock.move_item = function (item, source, target, actual_qty, rate, call frappe.call({ method: 'erpnext.stock.doctype.stock_entry.stock_entry_utils.make_stock_entry', args: values, + btn: dialog.get_primary_btn(), freeze: true, + freeze_message: __('Creating Stock Entry'), callback: function (r) { frappe.show_alert(__('Stock Entry {0} created', ['' + r.message.name + ''])); From ecbb8cbc844ca451b76fb0fa4fdc30fd7592aad2 Mon Sep 17 00:00:00 2001 From: Ankush Menat Date: Tue, 18 May 2021 16:33:15 +0530 Subject: [PATCH 2/2] revert: "fix: duplicate stock entry (#25486)" Not required anymore, submit button is disabled. --- erpnext/stock/dashboard/item_dashboard.js | 3 --- 1 file changed, 3 deletions(-) diff --git a/erpnext/stock/dashboard/item_dashboard.js b/erpnext/stock/dashboard/item_dashboard.js index dfb9e44283..a657ecf105 100644 --- a/erpnext/stock/dashboard/item_dashboard.js +++ b/erpnext/stock/dashboard/item_dashboard.js @@ -230,7 +230,6 @@ erpnext.stock.move_item = function (item, source, target, actual_qty, rate, call }, ], }); - var submitted = false; dialog.show(); dialog.get_field('item_code').set_input(item); @@ -254,7 +253,6 @@ erpnext.stock.move_item = function (item, source, target, actual_qty, rate, call } dialog.set_primary_action(__('Submit'), function () { - if(submitted) return; var values = dialog.get_values(); if (!values) { return; @@ -267,7 +265,6 @@ erpnext.stock.move_item = function (item, source, target, actual_qty, rate, call 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,