How to constrain the use of SINV-RET in the case of credit note

Good afternoon,
Is there any easy way to constraint the use of the naming series SINV-RET in the case of sales return?
If so, how can I go about it?


Add Naming Series Setup >> Naming Series SINV-RET for your DocType
write custom script for your DocType


frappe.ui.form.on("DocType", {
	refresh: function(frm) {
		if(frm.doc.is_return && frm.doc.__islocal) {
			frm.doc.naming_series = "SINV-RET"
1 Like