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.
@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.
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
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)
Correct syntax is PO-16-.supplier_code.-#### where supplier_code is custom field in Purchase Order.
Make sure supplier code is present before you save PO.
OR
To test feature, you can take supplier code custom field in PO and add supplier code manually in PO.
I have the same problem.
In the quotation I want to use the number QN.YYYY.MM.-.####, Where YYYYMM was taken from the āDateā
I have tried it in the quotation and the results are quite satisfactory, when I create a new quote and fill in the āDateā for example, January 1st, 2017, the naming series that is produced is QN201701-0001, but the date on the server is already in March.
In the ācustomize formā Quotation, add āFieldā with the name ādate_for_seriesā
Create a custom script for a quote, as follows:
var date_for_series = function(frm){
var ymd = frm.doc.transaction_date;
var yy = ymd.substring(0,4);
var mm = ymd.substring(5,7);
var ym = yy+āā+mm;
frm.set_value(ādate_for_seriesā, ym);
}
frappe.ui.form.on(āQuotationā, āvalidateā, function(frm) {
date_for_series(frm);
})
3.Create naming_series by name: QN.date_for_series.-.####
Of course there are still some weaknesses.
[quote=āhendrik_zeta, post:31, topic:10865ā]
n the quotation I want to use the number QN.YYYY.MM.-.####, Where YYYYMM was taken from the āDateā
[/quote]
@hendrik_zeta I am making same thing for one client,
So in Quote I will take it from quotation_date and in sales invoice I will take YYMM from transaction_date.
Can you suggest generic design to add it in customise form and doctype naming series, if this will help, I would like to add it in default erpnext feature
We want to use naming scheme, which will assign predefined abbreviations instead of full words. E.g. ITEM-2017-03-05-R instead of ITEM-2017-03-Apple-Red, where value Apple is predefined as 05 and value Red is predefined as R.
Is this possible to achieve by custom script, not touching source code?
@strixaluco yes this is possible using custom script and custom fields, you need to add custom field for abbr. Then using custom script you can set values in abbr.
It will auto pickup in naming series.
Itās a pity, but seems like my understanding of scripting is not enough.
I added two custom fields to Item doctype:
# label type options
1 Fruit Select Apple
Pear
Banana
2 Color Select Yellow
Green
Red
Letās imagine Iām creating new item selecting Apple as Fruit and Green as Color. Chosen naming scheme is ITEM-YYYY-MM-FRUIT-COLOR, which gives us ITEM-2017-03-Apple-Green in the example.
But what we want is to assign abbreviations as following:
# label type options abbreviation
1 Fruit Select Apple AP
Pear PR
Banana BN
2 Color Select Yellow 01
Green 02
Red 03
so that the system generates ITEM-2017-03-AP-02 instead.