You can use custom field in naming series along with YY MM DD option

@kolate_sambhaji Nice one. I have created one based on the user abbr

eg

QTN-.YY.-user_abbr-.###

This produces with suppose user Ankit Fadia = QTN-16-AF-001

Another user say Umair Sayyed = QTN-16-AF-001

Now how do I updated the series with them. Because in the setup it just shows QTN-.YY.-.user_abbr.-.###

1 Like

@vivek
naming series is auto-incremented.
If you want to change current value or start naming series from 100 then you can set current value for naming series.
https://frappe.github.io/erpnext/user/manual/en/setting-up/articles/naming-series-current-value

@kolate_sambhaji I did try the above but what it doesnt change the current value. If i set value to 100, still each of those resulting series are treated differently

Meaning

Create quote 1 by user AA - > QTN-16-AA-001
Create quote 2 by user US - > QTN-16-US-001
Create quote 3 by user US - > QTN-16-US-002
Create quote 4 by user AA - > QTN-16-AA-002

even if change the current value, it is off no effect

@vivek
Need to fix this issue for current value, I will check this.

For now, you can create for quote by user AA and then rename QTN-16-AA-001 to QTN-16-AA-100, keep this quote in system and make new quote, you will get new quote with number QTN-16-AA-101.

@vivek Its working fine in my setup.
You need to add naming series QTN-.YY.-.user_abbr.-.###, Note: user_abbr should be available in quotation before creation of quotation.

Alternative option:
Write method in you custom app and call from hooks.

    "Quotation": {
        "before_insert": "custom_app.custom_py_methods.quote_autoname",
    },

custom_py_methods.py

from frappe.model.naming import make_autoname
    def quote_autoname(doc,method):
        cc=str(frappe.db.get_value("User",{"name":doc.owner},"user_abbr"))
        qo_name = "QTN-16"+cc+".####"
        substring_so = make_autoname(qo_name + '.####')
        doc.name=str(substring_so)
1 Like

I have a custom field (type: Data) under Supplier called Supplier Code → supplier_code

In naming series I tested PO-.YY.-.{supplier_code}.-.##### but that gives:
Special Characters except “-”, “#”, “.” and “/” not allowed in naming series

If I do it without the curly-brackets supplier_code doesn’t get replaced, instead gets printed as the work ‘supplier_code’.

tips?

Updated to ERPNext: v7.2.5, still same issue with curly-brackets not allowed in naming series.

If I run without, i.e. simply PO-.YY.-.supplier_code.-.#####,
creating a PO will become PO-16-supplier_code-00011

@raveslave supplier_code is present in Supplier and not present in Purchase Order
Make sure supplier_code is present in Purchase Order before you save it.

You can use PO-16-supplier_code-#### series only if supplier code is present in purchase order.

to test series is working or not try naming series PO-16-supplier-####

Thanks,
Sambhaji
http://sbkolate.com

Hi & thx Sambhaji,

I did add supplier_code to the Purchase Order Form (see img below), still don’t manage to get it replaced with the supplier_code inherited from the Supplier.

Or did you mean I need to customize and add it to the DocType for PO? Seems adding rows there is possible but not editable. Sorry being such a newbie :slight_smile:

@raveslave you can add supplier_code in PO and write custom script add fetch, to fetch supplier code from Supplier

Hi Kolate,

As you can see in my screen shot in the previous post, supplier_code is indeed part of the PO-form. Still not working.

Custom-script is fine as a workaround. Any hints on where to do this. I was under the impression in the first post in this thread that this is not needed if using .-.{vendor_id}.- or .-.vendor_id.- (as curly brackets is not allowed in naming-series)

best david

@raveslave we are using dot . to separate custom field name.
So PO-16-.supplier_code.-#### is correct syntax

thx! still no go, hmm. does it work on your side?

Am I right off making the new field in
Form: Purchase Order
Field “Supplier Code”
Type: “Data”
by erpnext, auto-gen field-name: supplier_code
and in last column: “Supplier” (not sure if this matters)

Hi @kolate_sambhaji,

This functionality is great. I wonder though which is should only be applied to naming series. I think with a small change it can also be used to build composite name fields for doctypes. So for example, if I have a doctype with fields X, Y and Z, in addition to the possibility of an auto name .X.-.Y.-.#### I should also be able to have just .X.-.Y.

What do you think?

Regards,
cksgb

@raveslave can you check PO-16-.supplier.-####? if this is working, then check whether you get data in supplier code.

Anyways, you can Skype me at kolate.sambhaji and we can have a look at this problem.

Frappe team developed option to add YY MM DD and I have added option to add custom field in naming series and this is working for us.

@Chude_Osiegbu currently you can use fields present in same doctype only. Its great suggestion to use fields from another doctype.
Can you post issue on github?
I will check this if I can develop this.

Hi @kolate_sambhaji ,

Thanks but I meant whether it’s possible to remove the requirement for #### in the auto name rule. Sometimes you want to concatenate fields into the name without appending an auto-incrementing number

Regards,
cksgb

@Chude_Osiegbu yes you can remove .####

Hmm… Will try again. Didn’t seem to work when I tried earlier. Thanks.

1 Like

Hi @kolate_sambhaji

I tested with .supplier. and that works. So not sure what’s going wrong here.
pls help confirm that it’s correctly setup (see the screenshot in my post from Dec 16 above)

best david

1 Like