I am sharing some naming series option which will be helpful.
You can now use custom fields in naming series.
You can also use YY MM DD in naming series, where YY represent current Year, MM represent current Month and DD represent Today.
You can also use fields from document in naming series like supplier code/customer code
Examples:
QTN-.YYYY.-.customer.-.####
Resulting in QTN-2016-SBK-0001 (Asuming SBK is selected customer in Quotation)
PO-.YY.MM.-.{vendor_id}.-.#####
Resulting in “PO-1603-WN-00001” (where “Vendor ID” is custom field created under Document: Supplier and fetched into Purchase Order.)
DE/./.YY./.MM./.##### will create a series like
DE/16/03/0001 where 16 is the year, 03 is the month and 0001 is the series
Autoname rules:
The key is separated by ‘.’
‘####’ represents a series. The string before this part becomes the prefix:
ABC.#### creates a series ABC0001, ABC0002 etc
‘MM’ represents the current month
‘YY’ and ‘YYYY’ represent the current year
Each Series Prefix on a new line.Allowed special characters are “/” and "-"Optionally, set the number of digits in the series using dot (.) followed by hashes (#). For example, “.####” means that the series will have four digits.
Default is five digits.
@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.
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’.
@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-####
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
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)
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)