hi, where we can find the complete list of field we can use in naming? like .customer or {vendor_id}
@synertic You can use all fields present in form.
You find complete list here or from customize form
https://frappe.github.io/erpnext/current/models/selling/sales_order.html
Can you please confirm if this feature is working for:
ERPNext: v6.27.3
Frappe Framework: v6.27.4
It is not working for me. TIA
@hanstel its available in version you specified.
What naming series your are using and what it the output you are getting?
To test same, you can create new naming series on Quotation as QTN-.YYYY.-.customer.-.####
Then try to create new quotation with updated naming series
i am getting literals YY and fields, no translation is happening.
Example:
naming series: PLAN-.YY-.####
i’m getting a name of PLAN-YY-0001
@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.-.###
@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)
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
@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