I created ‘Order Acceptance’ doctype.Now i will fetch data from quotation and sales order in order acceptance doctype. So i make custome button(‘Get Item From’) throught “.js” in order acceptance. the code is
// Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and contributors
// For license information, please see license.txt
cur_frm.pformat.print_heading = ‘Test Order Acceptance’;
{% include ‘erpnext/selling/sales_common.js’ %};
frappe.provide(“erpnext.accounts”);
frappe.ui.form.on(‘Test Order Acceptance’,
{
setup: function(frm)
{
},
refresh: function(doc, dt, dn)
{
cur_frm.add_custom_button(__('Get From Item'),
function()
{
frappe.model.map_current_doc
({
method: "erpnext.selling.doctype.quotation.quotation.make_stock_entry",
source_doctype: "Quotation",
get_query_filters:
{
docstatus: 1,
status: ["!=", "Lost"],
order_type: cur_frm.doc.order_type,
customer: cur_frm.doc.customer || undefined,
company: cur_frm.doc.company
}
})
});
},
});
When i click on button(‘Get Item From’) then popup the quotation & sales order.
how to add that two doctypes inside button throught “.js” file.