Calculations in naming series

Is there any way by which I can calculate in the naming series, for example, If the current financial year is 2021-2022 and putting .YYYY. in naming series gives 2021 only and it will give 2022 from January 2022 onwards which looks out of place in a financial year from april 21 to mar 21.

Hence, How to achieve this 2122 in naming series?
p.s. I want it to be automatic so that there is no need to change in further financial years.
Thanks

Hey @prateek.m,

For this, you need to create a custom script for the.

For example, for use case was also the same as yours, so What I have done is as follow:-

  • Created a new field named fiscal_year in the doctype.
  • Set the current fiscal year value to the fiscal_year field from the custom script.
  • In Doctype created a field named naming_series and set the option as PO-#######-.fiscal_year(custom field name)

Hope this help you

Tested and works in

ERPNext: v13.0.0-beta.14 (version-13-beta)

Frappe Framework: v13.0.0-beta.12 (version-13-beta)

Thanks its working.
But my use case needs it to be total 4 digits like 2122, is that possible?

This requires a change in the core document.
I would give you a piece of advice that you should do well with manual like this : PO/21-22/001