Below example is of Sales Invoice if Is return is marked the series will be of the CN-0001 or else the series will be SI-0001
frappe.ui.form.on("Sales Invoice", { before_save(frm) { if(frm.doc.__islocal == 1){ if(frm.doc.is_return == 1){ (frm.set_value('naming_series', 'CN-.####')); }else{ (frm.set_value('naming_series', 'SI-.####')); } } } });
0 Comments