fix: duplicate stock entry (#25486)
Co-authored-by: Ankush Menat <ankush@iwebnotes.com>
This commit is contained in:
parent
87baa646e7
commit
bdba064fa6
@ -230,6 +230,7 @@ erpnext.stock.move_item = function (item, source, target, actual_qty, rate, call
|
|||||||
},
|
},
|
||||||
],
|
],
|
||||||
});
|
});
|
||||||
|
var submitted = false;
|
||||||
dialog.show();
|
dialog.show();
|
||||||
dialog.get_field('item_code').set_input(item);
|
dialog.get_field('item_code').set_input(item);
|
||||||
|
|
||||||
@ -253,6 +254,7 @@ erpnext.stock.move_item = function (item, source, target, actual_qty, rate, call
|
|||||||
}
|
}
|
||||||
|
|
||||||
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;
|
||||||
@ -265,6 +267,7 @@ erpnext.stock.move_item = function (item, source, target, actual_qty, rate, call
|
|||||||
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,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user