mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-31 10:49:09 +00:00
fix: stock move dialog duplicate submit actions (#24859)
* fix: duplicate submit actions * fix sider errors.
This commit is contained in:
committed by
GitHub
parent
55d45532b4
commit
2e2f3f9578
@@ -156,7 +156,8 @@ erpnext.stock.move_item = function(item, source, target, actual_qty, rate, callb
|
|||||||
fieldtype: 'Float', description: __('Available {0}', [actual_qty]) },
|
fieldtype: 'Float', description: __('Available {0}', [actual_qty]) },
|
||||||
{fieldname: 'rate', label: __('Rate'), fieldtype: 'Currency', hidden: 1 },
|
{fieldname: 'rate', label: __('Rate'), fieldtype: 'Currency', hidden: 1 },
|
||||||
],
|
],
|
||||||
})
|
});
|
||||||
|
var submitted = false;
|
||||||
dialog.show();
|
dialog.show();
|
||||||
dialog.get_field('item_code').set_input(item);
|
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() {
|
dialog.set_primary_action(__('Submit'), function() {
|
||||||
|
if(submitted) return;
|
||||||
var values = dialog.get_values();
|
var values = dialog.get_values();
|
||||||
if(!values) {
|
if(!values) {
|
||||||
return;
|
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'));
|
frappe.msgprint(__('Source and target warehouse must be different'));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
submitted = true;
|
||||||
frappe.call({
|
frappe.call({
|
||||||
method: 'erpnext.stock.doctype.stock_entry.stock_entry_utils.make_stock_entry',
|
method: 'erpnext.stock.doctype.stock_entry.stock_entry_utils.make_stock_entry',
|
||||||
args: values,
|
args: values,
|
||||||
|
|||||||
Reference in New Issue
Block a user