Say I have two companies A and B. I want naming for Sales Invoice to be set by user in A and I want B to use a series as naming. Is that possible?
NCP
September 22, 2023, 6:33pm
2
Yes, possible @zeeeeeeeero .
@zeeeeeeeero ,
Please check this thread. this may help.
Hi, @Pararera , I have applied custom script on Sales Invoice based selection of company.
Please make series field Read only from customize sales invoice
[com-video-to-gif]
frappe.ui.form.on("Sales Invoice", {
company: cur_frm.cscript.company = function(doc, cdt, cdn){
//function(frm){
// this function is called when the value of company is changed.
if(cur_frm.doc.company=== 'Demo India Pvt. Ltd.'){
cur_frm.set_value("naming_series","PO/ABC/.###");
}
else if(cur_frm.doc.company == 'Test In…
Thanks.
How do I do it? Preferably without scripts
@zeeeeeeeero Or you can add these two series in the DocType Document naming settings then after update. You can select manually based on the company before saving the document.
For your Reference:
https://docs.erpnext.com/docs/user/manual/en/document-naming-settings