Revert "fix : Create Pick List Fos Sales Order List (#20915)" (#21352)

This reverts commit 27c6f694359bf211bd2e457af6b2ef59d48ff5a9.
This commit is contained in:
Nabin Hait 2020-04-21 14:28:08 +05:30 committed by GitHub
parent a529a5078f
commit 5f77854448
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -47,41 +47,6 @@ frappe.listview_settings['Sales Order'] = {
listview.page.add_menu_item(__("Re-open"), function() {
listview.call_for_selected_items(method, {"status": "Submitted"});
});
},
onload: function(doclist) {
const action = () => {
const selected_docs = doclist.get_checked_items();
const docnames = doclist.get_checked_items(true);
if (selected_docs.length > 0) {
for (let doc of selected_docs) {
if (!doc.docstatus) {
frappe.throw(__("Cannot create a Pick List from Draft documents."));
}
};
frappe.new_doc("Pick List")
.then(() => {
frappe.call({
type: "POST",
method: "frappe.model.mapper.map_docs",
args: {
"method": "erpnext.selling.doctype.sales_order.sales_order.create_pick_list",
"source_names": docnames,
"target_doc": cur_frm.doc
},
callback: function (r) {
if (!r.exc) {
frappe.model.sync(r.message);
cur_frm.dirty();
cur_frm.refresh();
}
}
});
})
};
};
doclist.page.add_actions_menu_item(__('Create Pick List'), action, false);
}
};