ERPNext Foundation ERPNext Cloud Chat Blog Discuss Frappé* Donate

Make: Sales Order trigger


#1

How can I activate a function when I click on Sales Order button?

Tried:

frappe.ui.form.on('Quotation', sales_order, function () {
   console.log('Hello world!');
});


#2

Hi @Leonardo_Augusto

Try it

//Overwrite Make Sales Order funtion
 cur_frm.cscript['Make Sales Order'] = function() {
    alert('Hello world!');
    //Orginal of funtion
    frappe.model.open_mapped_doc({
		method: "erpnext.selling.doctype.quotation.quotation.make_sales_order",
		frm: cur_frm
	})
}

#3

Thank you very much!