Naming Series With Custom Field Not Auto Incrementing


I have created a custom filed in Doc Quotation which has Fieldname “abr”. This field is a Filed Type “Select”. It’s Options is “AMA” and “HL”.

For Naming Series for Quotation i have Q/.abr./.#####./.YY./VT but the series does not auto increment.

I get as below:
Q/AMA/00001/17/VT - 1st Quotation
Q/HL/00001/17/VT - 2nd Quotation
Q/AMA/00002/17/VT - 3rd Quotation
Q/HL/00002/17/VT - 4th Quotation

Could you please guide me on how I can get as below (or advise me if this is not possible):
Q/AMA/00001/17/VT - 1st Quotation
Q/HL/00002/17/VT - 2nd Quotation
Q/AMA/00003/17/VT - 3rd Quotation
Q/HL/00004/17/VT - 4th Quotation

Thank you.
Kind regards,

You have to write a custom script

Look in getseries() here ./apps/frappe/frappe/model/

@JoEz & @clarkej

Thank you for pointing me in the right direction.

And here are a few tests to start with

frappe@erpnext:~/frappe-bench$ find . -name *.py | grep test_* | xargs grep make_autoname