fix: stock move dialog duplicate submit actions (#24859)

* fix: duplicate submit actions

* fix sider errors.
This commit is contained in:
Devin Slauenwhite
2021-03-15 08:27:37 -04:00
committed by GitHub
parent 55d45532b4
commit 2e2f3f9578

View File

@@ -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,