From custom doc called Machine Inspection to Create Sales Invoice here is my code
frappe.ui.form.on('Machine Inspection', {
refresh: function(frm) {
if (frm.doc.status == 'Completed'){
frm.add_custom_button(__('Create Invoice'), () => {
frappe.new_doc('Sales Invoice', {}, inv => {
inv.inspection_reference = frm.doc.name;
inv.customer = frm.doc.party_name;
});
}, __('Go to'));
}
}
});
While clicking Create Invoice then nothing is being carry forwarded to invoice.
Please guide I’m very new to even JS is also new.
Thank you