Custom script to make Item Code in product an autu-increment field

Hello All,

Rushabh suggested I post this query to the forum;


How can I make the 'Item Code' field an auto-increment field? 

My example is as follows. I have a list of products with the item code taking the format 'F#####', for example, F12345, F12346, F12347 etc.

When I create a new product, I want the Item Code to automatically be populated with the next available number. I'm told this can be done with a custom script.


Thanks,
-Jev



Note:

 

If you are posting an issue,

  1. We should be able to replicate it at our end. So please give us as much information as you can. Please see it from the point of view of the person receiving the communication.
  2. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
  3. For sending images, use http://imgur.com or other similar services. Do not send images as attachments. Links are good. Same goes for any file you are going to send.

     

    End of Note



    You received this message because you are subscribed to the Google Groups “ERPNext Developer Forum” group.

    To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-developer-forum+un...@googlegroups.com.

    For more options, visit https://groups.google.com/groups/opt_out.

Hi Jev,

You can go to Stock > Stock Settings and set Item Naming by Naming Series. I think this is what you are looking for.

Best,
Anand Doshi.

On 24 November 2013 at 5:43:04 am, Jev Björsell (eb...@gmail.com) wrote:

Hello All,

Rushabh suggested I post this query to the forum;

How can I make the ‘Item Code’ field an auto-increment field?

My example is as follows. I have a list of products with the item code
taking the format ‘F#####’, for example, F12345, F12346, F12347 etc.

When I create a new product, I want the Item Code to automatically be
populated with the next available number. I’m told this can be done with a
custom script.

Thanks,
-Jev


Note:

If you are posting an issue,

  1. We should be able to replicate it at our end. So please give us as much information as you can. Please see it from the point of view of the person receiving the communication.
  2. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
  3. For sending images, use http://imgur.com or other similar services. Do not send images as attachments. Links are good. Same goes for any file you are going to send.

End of Note

You received this message because you are subscribed to the Google Groups “ERPNext Developer Forum” group.
To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-developer-forum+un...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Note:

If you are posting an issue,

  1. We should be able to replicate it at our end. So please give us as much information as you can. Please see it from the point of view of the person receiving the communication.
  2. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
  3. For sending images, use http://imgur.com or other similar services. Do not send images as attachments. Links are good. Same goes for any file you are going to send.

End of Note

You received this message because you are subscribed to the Google Groups “ERPNext Developer Forum” group.
To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-developer-forum+un...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Hi,

I require the same, as stated above. This method works well for Customer and Supplier. However, for Project, I am unable to find ‘Project Settings’.

Is there any other way to do this? Would appreciate any help.

Thank you.