Override naming series class for a very specific need

How, Could I override or extend this , for Work Order Document def __init__(self, series: str)

class NamingSeries:
  __slots__ = ("series",)

def __init__(self, series: str):
	self.series = series

	# Add default number part if missing
	if "#" not in self.series:
		self.series += ".#####"

You customize the naming operation with client script. There should be an autoname event.

1 Like

My case something like this

class NamingSeries:
  __slots__ = ("series",)

def __init__(self, series: str):
	self.series = series

	# Add default number part if missing
	if "#" not in self.series:
		self.series += "" # i don't need any extra seq. number since my field is unique already.

What should be the end result for the naming part.
If you just want an Integer which increments one by one, you can set it as Autoincrement in the doctype.

Go to the customize form of work order, scroll down to the naming section below the fields table. There you can change the naming series to a custom unique field that you require.

If you want to change the format of the naming series then go to the document naming settings and select work order and provide your new series.