[fix][awesomebar] remove saved new doc entries (#3673)

This commit is contained in:
Prateeksha Singh 2017-07-13 11:50:45 +05:30 committed by Makarand Bauskar
parent 406155750d
commit bb861f4a50

View file

@ -176,6 +176,8 @@ frappe.ui.form.save = function (frm, action, callback, btn) {
console.log("Already saving. Please wait a few moments.")
throw "saving";
}
frappe.ui.form.remove_old_form_route();
frappe.ui.form.is_saving = true;
return frappe.call({
@ -206,7 +208,18 @@ frappe.ui.form.save = function (frm, action, callback, btn) {
}
}
frappe.ui.form.update_calling_link = function (newdoc) {
frappe.ui.form.remove_old_form_route = () => {
let index = -1;
let current_route = frappe.get_route();
frappe.route_history.map((arr, i) => {
if (arr.join("/") === current_route.join("/")) {
index = i;
}
});
frappe.route_history.splice(index, 1);
}
frappe.ui.form.update_calling_link = (newdoc) => {
if (frappe._from_link && newdoc.doctype === frappe._from_link.df.options) {
var doc = frappe.get_doc(frappe._from_link.doctype, frappe._from_link.docname);
// set value