How to apply a patch in custom app?

Hi,

I have tried to understand the developer guide but could not find any guide as to how to apply patches. Basically what I am doing is that I have a set of code running on item codes for item master, now every now and then this file of code is changed to apply new rules to items.

The initial practice I do is that I commit my code changes on github and then to check if all items are ok and are within the ambit of the rules in the code, I generally import all items with one field.

Now the problem is that this method of importing all items is very lengthy and cumbersome and hence I was thinking if I could somehow try to make all items get checked through the code via the patches path then it would be great.

–

Note:

 

If you are posting an issue,

 

  1. ERPNext is a free and open source software and support is given on this forum by a team (https://frappe.io/webnotes). So please consider donating if you find this forum useful (https://frappe.io/buy). Even a small amount would be helpful.
  2. 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.
  3. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
  4. 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.

    To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/ebe945db-f562-4d5c-ac97-bbdd09a7d3ed%40googlegroups.com.

    For more options, visit https://groups.google.com/d/optout.
On 22-Aug-2014, at 8:29 pm, Aditya Duggal <ad...@gmail.com> wrote:

Hi,

I have tried to understand the developer guide but could not find any guide as to how to apply patches. Basically what I am doing is that I have a set of code running on item codes for item master, now every now and then this file of code is changed to apply new rules to items.

1. Create a /patches folder in your app
2. Add your patch code file there. The patch file must be a python file with a function called "execute" 


3. Add the files in the patches.txt file in your repo

Similar to this


Thats it. Your patches will be automatically run when you run latest



The initial practice I do is that I commit my code changes on github and then to check if all items are ok and are within the ambit of the rules in the code, I generally import all items with one field.

Now the problem is that this method of importing all items is very lengthy and cumbersome and hence I was thinking if I could somehow try to make all items get checked through the code via the patches path then it would be great.


–

Note:

 

If you are posting an issue,

 

  1. ERPNext is a free and open source software and support is given on this forum by a team (https://frappe.io/webnotes). So please consider donating if you find this forum useful (https://frappe.io/buy). Even a small amount would be helpful.
  2. 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.
  3. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
  4. 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.

    To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/ebe945db-f562-4d5c-ac97-bbdd09a7d3ed%40googlegroups.com.

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

–

Note:

 

If you are posting an issue,

 

  1. ERPNext is a free and open source software and support is given on this forum by a team (https://frappe.io/webnotes). So please consider donating if you find this forum useful (https://frappe.io/buy). Even a small amount would be helpful.
  2. 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.
  3. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
  4. 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.

    To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/8209AC98-54D9-411E-B1E4-C66C2006A696%40gmail.com.

    For more options, visit https://groups.google.com/d/optout.
2 Likes
Thanks Rushabh,

I am trying the things as I write this post but stumbled upon 2 more things, 

  1. I would like to find and apply patch to those items which are showing in golden color (means items which are not saved), I am unable to find a way to find those items.
  2. Would the patch run every time we do the update of the app



On Saturday, August 23, 2014 2:22:22 PM UTC+5:30, rushabh wrote:
On 22-Aug-2014, at 8:29 pm, Aditya Duggal <ad...@gmail.com> wrote:

Hi,

I have tried to understand the developer guide but could not find any guide as to how to apply patches. Basically what I am doing is that I have a set of code running on item codes for item master, now every now and then this file of code is changed to apply new rules to items.

1. Create a /patches folder in your app
2. Add your patch code file there. The patch file must be a python file with a function called "execute" 


3. Add the files in the patches.txt file in your repo

Similar to this


Thats it. Your patches will be automatically run when you run latest



The initial practice I do is that I commit my code changes on github and then to check if all items are ok and are within the ambit of the rules in the code, I generally import all items with one field.

Now the problem is that this method of importing all items is very lengthy and cumbersome and hence I was thinking if I could somehow try to make all items get checked through the code via the patches path then it would be great.


–

Note:

 

If you are posting an issue,

 

  1. ERPNext is a free and open source software and support is given on this forum by a team (https://frappe.io/webnotes). So please consider donating if you find this forum useful (https://frappe.io/buy). Even a small amount would be helpful.
  2. 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.
  3. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
  4. 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.

    To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/ebe945db-f562-4d5c-ac97-bbdd09a7d3ed%40googlegroups.com.

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

–

Note:

 

If you are posting an issue,

 

  1. ERPNext is a free and open source software and support is given on this forum by a team (https://frappe.io/webnotes). So please consider donating if you find this forum useful (https://frappe.io/buy). Even a small amount would be helpful.
  2. 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.
  3. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
  4. 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.

    To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/226a36f5-d8f1-47c6-999f-caadbcf522c3%40googlegroups.com.

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

On 25-Aug-2014, at 1:48 pm, Aditya Duggal <ad...@gmail.com> wrote:

Thanks Rushabh,

I am trying the things as I write this post but stumbled upon 2 more things, 

  1. I would like to find and apply patch to those items which are showing in golden color (means items which are not saved), I am unable to find a way to find those items.
there must be some way to find them out! (SQL ?)
  1. Would the patch run every time we do the update of the app

No only once - system keeps track of all patches installed.




On Saturday, August 23, 2014 2:22:22 PM UTC+5:30, rushabh wrote:
On 22-Aug-2014, at 8:29 pm, Aditya Duggal <ad...@gmail.com> wrote:

Hi,

I have tried to understand the developer guide but could not find any guide as to how to apply patches. Basically what I am doing is that I have a set of code running on item codes for item master, now every now and then this file of code is changed to apply new rules to items.

1. Create a /patches folder in your app
2. Add your patch code file there. The patch file must be a python file with a function called "execute" 


3. Add the files in the patches.txt file in your repo

Similar to this


Thats it. Your patches will be automatically run when you run latest



The initial practice I do is that I commit my code changes on github and then to check if all items are ok and are within the ambit of the rules in the code, I generally import all items with one field.

Now the problem is that this method of importing all items is very lengthy and cumbersome and hence I was thinking if I could somehow try to make all items get checked through the code via the patches path then it would be great.


–

Note:

 

If you are posting an issue,

 

  1. ERPNext is a free and open source software and support is given on this forum by a team (https://frappe.io/webnotes). So please consider donating if you find this forum useful (https://frappe.io/buy). Even a small amount would be helpful.
  2. 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.
  3. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
  4. 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.

    To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/ebe945db-f562-4d5c-ac97-bbdd09a7d3ed%40googlegroups.com.

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


–

Note:

 

If you are posting an issue,

 

  1. ERPNext is a free and open source software and support is given on this forum by a team (https://frappe.io/webnotes). So please consider donating if you find this forum useful (https://frappe.io/buy). Even a small amount would be helpful.
  2. 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.
  3. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
  4. 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.

    To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/226a36f5-d8f1-47c6-999f-caadbcf522c3%40googlegroups.com.

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

–

Note:

 

If you are posting an issue,

 

  1. ERPNext is a free and open source software and support is given on this forum by a team (https://frappe.io/webnotes). So please consider donating if you find this forum useful (https://frappe.io/buy). Even a small amount would be helpful.
  2. 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.
  3. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
  4. 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.

    To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/AF5D9755-8AA3-45A2-991B-6DC059C2A97A%40gmail.com.

    For more options, visit https://groups.google.com/d/optout.
I am getting this error:

ImportError: No module named patches.item_master.patch_item

Now this is my folder structure: frappe-bench/apps/rigpl-erpnext/rigpl_erpnext/patches/item_master/patch_item.py

Now I have a text file patches.txt in frappe-bench/apps/rigpl-erpnext/rigpl_erpnext

The line mentioned in patches.txt is rigpl_erpnext.patches.item_master.patch_item

Please note the difference in the rigpl-erpnext & rigpl_erpnext folders.

What am I missing?

On Monday, August 25, 2014 3:19:18 PM UTC+5:30, rushabh wrote:

On 25-Aug-2014, at 1:48 pm, Aditya Duggal <ad...@gmail.com> wrote:

Thanks Rushabh,

I am trying the things as I write this post but stumbled upon 2 more things, 

  1. I would like to find and apply patch to those items which are showing in golden color (means items which are not saved), I am unable to find a way to find those items.
there must be some way to find them out! (SQL ?)
  1. Would the patch run every time we do the update of the app

No only once - system keeps track of all patches installed.




On Saturday, August 23, 2014 2:22:22 PM UTC+5:30, rushabh wrote:
On 22-Aug-2014, at 8:29 pm, Aditya Duggal <ad...@gmail.com> wrote:

Hi,

I have tried to understand the developer guide but could not find any guide as to how to apply patches. Basically what I am doing is that I have a set of code running on item codes for item master, now every now and then this file of code is changed to apply new rules to items.

1. Create a /patches folder in your app
2. Add your patch code file there. The patch file must be a python file with a function called "execute" 


3. Add the files in the patches.txt file in your repo

Similar to this


Thats it. Your patches will be automatically run when you run latest



The initial practice I do is that I commit my code changes on github and then to check if all items are ok and are within the ambit of the rules in the code, I generally import all items with one field.

Now the problem is that this method of importing all items is very lengthy and cumbersome and hence I was thinking if I could somehow try to make all items get checked through the code via the patches path then it would be great.


–

Note:

 

If you are posting an issue,

 

  1. ERPNext is a free and open source software and support is given on this forum by a team (https://frappe.io/webnotes). So please consider donating if you find this forum useful (https://frappe.io/buy). Even a small amount would be helpful.
  2. 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.
  3. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
  4. 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.

    To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/ebe945db-f562-4d5c-ac97-bbdd09a7d3ed%40googlegroups.com.

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


–

Note:

 

If you are posting an issue,

 

  1. ERPNext is a free and open source software and support is given on this forum by a team (https://frappe.io/webnotes). So please consider donating if you find this forum useful (https://frappe.io/buy). Even a small amount would be helpful.
  2. 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.
  3. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
  4. 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.

    To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/226a36f5-d8f1-47c6-999f-caadbcf522c3%40googlegroups.com.

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

–

Note:

 

If you are posting an issue,

 

  1. ERPNext is a free and open source software and support is given on this forum by a team (https://frappe.io/webnotes). So please consider donating if you find this forum useful (https://frappe.io/buy). Even a small amount would be helpful.
  2. 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.
  3. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
  4. 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.

    To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/90090a0a-37c8-4b14-b6a4-8a43bc8a1855%40googlegroups.com.

    For more options, visit https://groups.google.com/d/optout.
Create a file __init__.py in patches folder. 

Sent from my phone

On 30-Aug-2014, at 11:40, Aditya Duggal <ad...@gmail.com> wrote:

I am getting this error:

ImportError: No module named patches.item_master.patch_item

Now this is my folder structure: frappe-bench/apps/rigpl-erpnext/rigpl_erpnext/patches/item_master/patch_item.py

Now I have a text file patches.txt in frappe-bench/apps/rigpl-erpnext/rigpl_erpnext

The line mentioned in patches.txt is rigpl_erpnext.patches.item_master.patch_item

Please note the difference in the rigpl-erpnext & rigpl_erpnext folders.

What am I missing?

On Monday, August 25, 2014 3:19:18 PM UTC+5:30, rushabh wrote:

On 25-Aug-2014, at 1:48 pm, Aditya Duggal <ad...@gmail.com> wrote:

Thanks Rushabh,

I am trying the things as I write this post but stumbled upon 2 more things, 

  1. I would like to find and apply patch to those items which are showing in golden color (means items which are not saved), I am unable to find a way to find those items.
there must be some way to find them out! (SQL ?)
  1. Would the patch run every time we do the update of the app

No only once - system keeps track of all patches installed.




On Saturday, August 23, 2014 2:22:22 PM UTC+5:30, rushabh wrote:
On 22-Aug-2014, at 8:29 pm, Aditya Duggal <ad...@gmail.com> wrote:

Hi,

I have tried to understand the developer guide but could not find any guide as to how to apply patches. Basically what I am doing is that I have a set of code running on item codes for item master, now every now and then this file of code is changed to apply new rules to items.

1. Create a /patches folder in your app
2. Add your patch code file there. The patch file must be a python file with a function called "execute" 


3. Add the files in the patches.txt file in your repo

Similar to this


Thats it. Your patches will be automatically run when you run latest



The initial practice I do is that I commit my code changes on github and then to check if all items are ok and are within the ambit of the rules in the code, I generally import all items with one field.

Now the problem is that this method of importing all items is very lengthy and cumbersome and hence I was thinking if I could somehow try to make all items get checked through the code via the patches path then it would be great.


–

Note:

 

If you are posting an issue,

 

  1. ERPNext is a free and open source software and support is given on this forum by a team (https://frappe.io/webnotes). So please consider donating if you find this forum useful (https://frappe.io/buy). Even a small amount would be helpful.
  2. 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.
  3. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
  4. 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.

    To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/ebe945db-f562-4d5c-ac97-bbdd09a7d3ed%40googlegroups.com.

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


–

Note:

 

If you are posting an issue,

 

  1. ERPNext is a free and open source software and support is given on this forum by a team (https://frappe.io/webnotes). So please consider donating if you find this forum useful (https://frappe.io/buy). Even a small amount would be helpful.
  2. 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.
  3. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
  4. 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.

    To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/226a36f5-d8f1-47c6-999f-caadbcf522c3%40googlegroups.com.

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

–

Note:

 

If you are posting an issue,

 

  1. ERPNext is a free and open source software and support is given on this forum by a team (https://frappe.io/webnotes). So please consider donating if you find this forum useful (https://frappe.io/buy). Even a small amount would be helpful.
  2. 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.
  3. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
  4. 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.

    To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/90090a0a-37c8-4b14-b6a4-8a43bc8a1855%40googlegroups.com.

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

–

Note:

 

If you are posting an issue,

 

  1. ERPNext is a free and open source software and support is given on this forum by a team (https://frappe.io/webnotes). So please consider donating if you find this forum useful (https://frappe.io/buy). Even a small amount would be helpful.
  2. 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.
  3. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
  4. 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.

    To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/7CDE7F6A-C950-48CE-9F9C-5B99E6BB7DCB%40iwebnotes.com.

    For more options, visit https://groups.google.com/d/optout.
Also in item_master folder

Sent from my phone

On 30-Aug-2014, at 11:40, Aditya Duggal <ad...@gmail.com> wrote:

I am getting this error:

ImportError: No module named patches.item_master.patch_item

Now this is my folder structure: frappe-bench/apps/rigpl-erpnext/rigpl_erpnext/patches/item_master/patch_item.py

Now I have a text file patches.txt in frappe-bench/apps/rigpl-erpnext/rigpl_erpnext

The line mentioned in patches.txt is rigpl_erpnext.patches.item_master.patch_item

Please note the difference in the rigpl-erpnext & rigpl_erpnext folders.

What am I missing?

On Monday, August 25, 2014 3:19:18 PM UTC+5:30, rushabh wrote:

On 25-Aug-2014, at 1:48 pm, Aditya Duggal <ad...@gmail.com> wrote:

Thanks Rushabh,

I am trying the things as I write this post but stumbled upon 2 more things, 

  1. I would like to find and apply patch to those items which are showing in golden color (means items which are not saved), I am unable to find a way to find those items.
there must be some way to find them out! (SQL ?)
  1. Would the patch run every time we do the update of the app

No only once - system keeps track of all patches installed.




On Saturday, August 23, 2014 2:22:22 PM UTC+5:30, rushabh wrote:
On 22-Aug-2014, at 8:29 pm, Aditya Duggal <ad...@gmail.com> wrote:

Hi,

I have tried to understand the developer guide but could not find any guide as to how to apply patches. Basically what I am doing is that I have a set of code running on item codes for item master, now every now and then this file of code is changed to apply new rules to items.

1. Create a /patches folder in your app
2. Add your patch code file there. The patch file must be a python file with a function called "execute" 


3. Add the files in the patches.txt file in your repo

Similar to this


Thats it. Your patches will be automatically run when you run latest



The initial practice I do is that I commit my code changes on github and then to check if all items are ok and are within the ambit of the rules in the code, I generally import all items with one field.

Now the problem is that this method of importing all items is very lengthy and cumbersome and hence I was thinking if I could somehow try to make all items get checked through the code via the patches path then it would be great.


–

Note:

 

If you are posting an issue,

 

  1. ERPNext is a free and open source software and support is given on this forum by a team (https://frappe.io/webnotes). So please consider donating if you find this forum useful (https://frappe.io/buy). Even a small amount would be helpful.
  2. 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.
  3. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
  4. 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.

    To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/ebe945db-f562-4d5c-ac97-bbdd09a7d3ed%40googlegroups.com.

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


–

Note:

 

If you are posting an issue,

 

  1. ERPNext is a free and open source software and support is given on this forum by a team (https://frappe.io/webnotes). So please consider donating if you find this forum useful (https://frappe.io/buy). Even a small amount would be helpful.
  2. 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.
  3. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
  4. 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.

    To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/226a36f5-d8f1-47c6-999f-caadbcf522c3%40googlegroups.com.

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

–

Note:

 

If you are posting an issue,

 

  1. ERPNext is a free and open source software and support is given on this forum by a team (https://frappe.io/webnotes). So please consider donating if you find this forum useful (https://frappe.io/buy). Even a small amount would be helpful.
  2. 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.
  3. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
  4. 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.

    To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/90090a0a-37c8-4b14-b6a4-8a43bc8a1855%40googlegroups.com.

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

–

Note:

 

If you are posting an issue,

 

  1. ERPNext is a free and open source software and support is given on this forum by a team (https://frappe.io/webnotes). So please consider donating if you find this forum useful (https://frappe.io/buy). Even a small amount would be helpful.
  2. 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.
  3. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
  4. 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.

    To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/A8B09766-DA15-4FD1-864C-C2A9CD532222%40iwebnotes.com.

    For more options, visit https://groups.google.com/d/optout.
Thanks a lot Anand, works fine.

Just wanted to know if I could reset the patch applied since I am kind of testing the application of patch and I am sometimes not aware what results would it bear.

Is it possible to somehow reset the list of patches applied so that I could test my patch files multiple times.

On Saturday, August 30, 2014 11:59:25 AM UTC+5:30, Anand Doshi wrote:
Also in item_master folder

Sent from my phone

On 30-Aug-2014, at 11:40, Aditya Duggal <ad...@gmail.com> wrote:

I am getting this error:

ImportError: No module named patches.item_master.patch_item

Now this is my folder structure: frappe-bench/apps/rigpl-erpnext/rigpl_erpnext/patches/item_master/patch_item.py

Now I have a text file patches.txt in frappe-bench/apps/rigpl-erpnext/rigpl_erpnext

The line mentioned in patches.txt is rigpl_erpnext.patches.item_master.patch_item

Please note the difference in the rigpl-erpnext & rigpl_erpnext folders.

What am I missing?

On Monday, August 25, 2014 3:19:18 PM UTC+5:30, rushabh wrote:

On 25-Aug-2014, at 1:48 pm, Aditya Duggal <ad...@gmail.com> wrote:

Thanks Rushabh,

I am trying the things as I write this post but stumbled upon 2 more things, 

  1. I would like to find and apply patch to those items which are showing in golden color (means items which are not saved), I am unable to find a way to find those items.
there must be some way to find them out! (SQL ?)
  1. Would the patch run every time we do the update of the app

No only once - system keeps track of all patches installed.




On Saturday, August 23, 2014 2:22:22 PM UTC+5:30, rushabh wrote:
On 22-Aug-2014, at 8:29 pm, Aditya Duggal <ad...@gmail.com> wrote:

Hi,

I have tried to understand the developer guide but could not find any guide as to how to apply patches. Basically what I am doing is that I have a set of code running on item codes for item master, now every now and then this file of code is changed to apply new rules to items.

1. Create a /patches folder in your app
2. Add your patch code file there. The patch file must be a python file with a function called "execute" 


3. Add the files in the patches.txt file in your repo

Similar to this


Thats it. Your patches will be automatically run when you run latest



The initial practice I do is that I commit my code changes on github and then to check if all items are ok and are within the ambit of the rules in the code, I generally import all items with one field.

Now the problem is that this method of importing all items is very lengthy and cumbersome and hence I was thinking if I could somehow try to make all items get checked through the code via the patches path then it would be great.


–

Note:

 

If you are posting an issue,

 

  1. ERPNext is a free and open source software and support is given on this forum by a team (https://frappe.io/webnotes). So please consider donating if you find this forum useful (https://frappe.io/buy). Even a small amount would be helpful.
  2. 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.
  3. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
  4. 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.

    To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/ebe945db-f562-4d5c-ac97-bbdd09a7d3ed%40googlegroups.com.

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


–

Note:

 

If you are posting an issue,

 

  1. ERPNext is a free and open source software and support is given on this forum by a team (https://frappe.io/webnotes). So please consider donating if you find this forum useful (https://frappe.io/buy). Even a small amount would be helpful.
  2. 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.
  3. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
  4. 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.

    To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/226a36f5-d8f1-47c6-999f-caadbcf522c3%40googlegroups.com.

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

–

Note:

 

If you are posting an issue,

 

  1. ERPNext is a free and open source software and support is given on this forum by a team (https://frappe.io/webnotes). So please consider donating if you find this forum useful (https://frappe.io/buy). Even a small amount would be helpful.
  2. 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.
  3. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
  4. 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.

    To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/90090a0a-37c8-4b14-b6a4-8a43bc8a1855%40googlegroups.com.

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

–

Note:

 

If you are posting an issue,

 

  1. ERPNext is a free and open source software and support is given on this forum by a team (https://frappe.io/webnotes). So please consider donating if you find this forum useful (https://frappe.io/buy). Even a small amount would be helpful.
  2. 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.
  3. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
  4. 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.

    To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/cbf7f64f-3a92-4715-97b5-1c31f9866e55%40googlegroups.com.

    For more options, visit https://groups.google.com/d/optout.
Hi Anand,

I found a way for the patches. Just enabled developer mode in my local account and gave the admin the rights to delete the patch log items.

Thanks once again for the help.



On Saturday, August 30, 2014 12:28:19 PM UTC+5:30, Aditya Duggal wrote:
Thanks a lot Anand, works fine.

Just wanted to know if I could reset the patch applied since I am kind of testing the application of patch and I am sometimes not aware what results would it bear.

Is it possible to somehow reset the list of patches applied so that I could test my patch files multiple times.

On Saturday, August 30, 2014 11:59:25 AM UTC+5:30, Anand Doshi wrote:
Also in item_master folder

Sent from my phone

On 30-Aug-2014, at 11:40, Aditya Duggal <ad...@gmail.com> wrote:

I am getting this error:

ImportError: No module named patches.item_master.patch_item

Now this is my folder structure: frappe-bench/apps/rigpl-erpnext/rigpl_erpnext/patches/item_master/patch_item.py

Now I have a text file patches.txt in frappe-bench/apps/rigpl-erpnext/rigpl_erpnext

The line mentioned in patches.txt is rigpl_erpnext.patches.item_master.patch_item

Please note the difference in the rigpl-erpnext & rigpl_erpnext folders.

What am I missing?

On Monday, August 25, 2014 3:19:18 PM UTC+5:30, rushabh wrote:

On 25-Aug-2014, at 1:48 pm, Aditya Duggal <ad...@gmail.com> wrote:

Thanks Rushabh,

I am trying the things as I write this post but stumbled upon 2 more things, 

  1. I would like to find and apply patch to those items which are showing in golden color (means items which are not saved), I am unable to find a way to find those items.
there must be some way to find them out! (SQL ?)
  1. Would the patch run every time we do the update of the app

No only once - system keeps track of all patches installed.




On Saturday, August 23, 2014 2:22:22 PM UTC+5:30, rushabh wrote:
On 22-Aug-2014, at 8:29 pm, Aditya Duggal <ad...@gmail.com> wrote:

Hi,

I have tried to understand the developer guide but could not find any guide as to how to apply patches. Basically what I am doing is that I have a set of code running on item codes for item master, now every now and then this file of code is changed to apply new rules to items.

1. Create a /patches folder in your app
2. Add your patch code file there. The patch file must be a python file with a function called "execute" 


3. Add the files in the patches.txt file in your repo

Similar to this


Thats it. Your patches will be automatically run when you run latest



The initial practice I do is that I commit my code changes on github and then to check if all items are ok and are within the ambit of the rules in the code, I generally import all items with one field.

Now the problem is that this method of importing all items is very lengthy and cumbersome and hence I was thinking if I could somehow try to make all items get checked through the code via the patches path then it would be great.


–

Note:

 

If you are posting an issue,

 

  1. ERPNext is a free and open source software and support is given on this forum by a team (https://frappe.io/webnotes). So please consider donating if you find this forum useful (https://frappe.io/buy). Even a small amount would be helpful.
  2. 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.
  3. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
  4. 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.

    To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/ebe945db-f562-4d5c-ac97-bbdd09a7d3ed%40googlegroups.com.

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


–

Note:

 

If you are posting an issue,

 

  1. ERPNext is a free and open source software and support is given on this forum by a team (https://frappe.io/webnotes). So please consider donating if you find this forum useful (https://frappe.io/buy). Even a small amount would be helpful.
  2. 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.
  3. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
  4. 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.

    To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/226a36f5-d8f1-47c6-999f-caadbcf522c3%40googlegroups.com.

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

–

Note:

 

If you are posting an issue,

 

  1. ERPNext is a free and open source software and support is given on this forum by a team (https://frappe.io/webnotes). So please consider donating if you find this forum useful (https://frappe.io/buy). Even a small amount would be helpful.
  2. 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.
  3. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
  4. 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.

    To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/90090a0a-37c8-4b14-b6a4-8a43bc8a1855%40googlegroups.com.

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

–

Note:

 

If you are posting an issue,

 

  1. ERPNext is a free and open source software and support is given on this forum by a team (https://frappe.io/webnotes). So please consider donating if you find this forum useful (https://frappe.io/buy). Even a small amount would be helpful.
  2. 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.
  3. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
  4. 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.

    To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/ed8edb18-6dc7-432c-ace1-6f2f00db4c7f%40googlegroups.com.

    For more options, visit https://groups.google.com/d/optout.
Hi,

I have just figured out that when I execute the patch then the validation code for that doctype is skipped. Is it possible to invoke the validations during the execution of the patch as I am unable to find a way to invoke validations while executing a patch.

On Saturday, August 30, 2014 12:43:05 PM UTC+5:30, Aditya Duggal wrote:
Hi Anand,

I found a way for the patches. Just enabled developer mode in my local account and gave the admin the rights to delete the patch log items.

Thanks once again for the help.



On Saturday, August 30, 2014 12:28:19 PM UTC+5:30, Aditya Duggal wrote:
Thanks a lot Anand, works fine.

Just wanted to know if I could reset the patch applied since I am kind of testing the application of patch and I am sometimes not aware what results would it bear.

Is it possible to somehow reset the list of patches applied so that I could test my patch files multiple times.

On Saturday, August 30, 2014 11:59:25 AM UTC+5:30, Anand Doshi wrote:
Also in item_master folder

Sent from my phone

On 30-Aug-2014, at 11:40, Aditya Duggal <ad...@gmail.com> wrote:

I am getting this error:

ImportError: No module named patches.item_master.patch_item

Now this is my folder structure: frappe-bench/apps/rigpl-erpnext/rigpl_erpnext/patches/item_master/patch_item.py

Now I have a text file patches.txt in frappe-bench/apps/rigpl-erpnext/rigpl_erpnext

The line mentioned in patches.txt is rigpl_erpnext.patches.item_master.patch_item

Please note the difference in the rigpl-erpnext & rigpl_erpnext folders.

What am I missing?

On Monday, August 25, 2014 3:19:18 PM UTC+5:30, rushabh wrote:

On 25-Aug-2014, at 1:48 pm, Aditya Duggal <ad...@gmail.com> wrote:

Thanks Rushabh,

I am trying the things as I write this post but stumbled upon 2 more things, 

  1. I would like to find and apply patch to those items which are showing in golden color (means items which are not saved), I am unable to find a way to find those items.
there must be some way to find them out! (SQL ?)
  1. Would the patch run every time we do the update of the app

No only once - system keeps track of all patches installed.




On Saturday, August 23, 2014 2:22:22 PM UTC+5:30, rushabh wrote:
On 22-Aug-2014, at 8:29 pm, Aditya Duggal <ad...@gmail.com> wrote:

Hi,

I have tried to understand the developer guide but could not find any guide as to how to apply patches. Basically what I am doing is that I have a set of code running on item codes for item master, now every now and then this file of code is changed to apply new rules to items.

1. Create a /patches folder in your app
2. Add your patch code file there. The patch file must be a python file with a function called "execute" 


3. Add the files in the patches.txt file in your repo

Similar to this


Thats it. Your patches will be automatically run when you run latest



The initial practice I do is that I commit my code changes on github and then to check if all items are ok and are within the ambit of the rules in the code, I generally import all items with one field.

Now the problem is that this method of importing all items is very lengthy and cumbersome and hence I was thinking if I could somehow try to make all items get checked through the code via the patches path then it would be great.


–

Note:

 

If you are posting an issue,

 

  1. ERPNext is a free and open source software and support is given on this forum by a team (https://frappe.io/webnotes). So please consider donating if you find this forum useful (https://frappe.io/buy). Even a small amount would be helpful.
  2. 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.
  3. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
  4. 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.

    To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/ebe945db-f562-4d5c-ac97-bbdd09a7d3ed%40googlegroups.com.

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


–

Note:

 

If you are posting an issue,

 

  1. ERPNext is a free and open source software and support is given on this forum by a team (https://frappe.io/webnotes). So please consider donating if you find this forum useful (https://frappe.io/buy). Even a small amount would be helpful.
  2. 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.
  3. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
  4. 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.

    To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/226a36f5-d8f1-47c6-999f-caadbcf522c3%40googlegroups.com.

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

–

Note:

 

If you are posting an issue,

 

  1. ERPNext is a free and open source software and support is given on this forum by a team (https://frappe.io/webnotes). So please consider donating if you find this forum useful (https://frappe.io/buy). Even a small amount would be helpful.
  2. 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.
  3. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
  4. 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.

    To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/90090a0a-37c8-4b14-b6a4-8a43bc8a1855%40googlegroups.com.

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

–

Note:

 

If you are posting an issue,

 

  1. ERPNext is a free and open source software and support is given on this forum by a team (https://frappe.io/webnotes). So please consider donating if you find this forum useful (https://frappe.io/buy). Even a small amount would be helpful.
  2. 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.
  3. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
  4. 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.

    To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/8ed031c2-943c-4270-bc5e-cd974ab8c246%40googlegroups.com.

    For more options, visit https://groups.google.com/d/optout.
Hi Aditya,

What exactly are you trying to do?

-Anand.


On Sat, Aug 30, 2014 at 12:58 PM, Aditya Duggal <ad...@gmail.com> wrote:
Hi,

I have just figured out that when I execute the patch then the validation code for that doctype is skipped. Is it possible to invoke the validations during the execution of the patch as I am unable to find a way to invoke validations while executing a patch.


On Saturday, August 30, 2014 12:43:05 PM UTC+5:30, Aditya Duggal wrote:

Hi Anand,


I found a way for the patches. Just enabled developer mode in my local account and gave the admin the rights to delete the patch log items.

Thanks once again for the help.




On Saturday, August 30, 2014 12:28:19 PM UTC+5:30, Aditya Duggal wrote:

Thanks a lot Anand, works fine.


Just wanted to know if I could reset the patch applied since I am kind of testing the application of patch and I am sometimes not aware what results would it bear.


Is it possible to somehow reset the list of patches applied so that I could test my patch files multiple times.

On Saturday, August 30, 2014 11:59:25 AM UTC+5:30, Anand Doshi wrote:
Also in item_master folder

Sent from my phone

On 30-Aug-2014, at 11:40, Aditya Duggal <ad...@gmail.com> wrote:

I am getting this error:


ImportError: No module named patches.item_master.patch_item

Now this is my folder structure: frappe-bench/apps/rigpl-erpnext/rigpl_erpnext/patches/item_master/patch_item.py


Now I have a text file patches.txt in frappe-bench/apps/rigpl-erpnext/rigpl_erpnext

The line mentioned in patches.txt is rigpl_erpnext.patches.item_master.patch_item

Please note the difference in the rigpl-erpnext & rigpl_erpnext folders.

What am I missing?

On Monday, August 25, 2014 3:19:18 PM UTC+5:30, rushabh wrote:

On 25-Aug-2014, at 1:48 pm, Aditya Duggal <ad...@gmail.com> wrote:

Thanks Rushabh,

I am trying the things as I write this post but stumbled upon 2 more things,

  1. I would like to find and apply patch to those items which are showing in golden color (means items which are not saved), I am unable to find a way to find those items.
there must be some way to find them out! (SQL ?)
  1. Would the patch run every time we do the update of the app

No only once - system keeps track of all patches installed.




On Saturday, August 23, 2014 2:22:22 PM UTC+5:30, rushabh wrote:
On 22-Aug-2014, at 8:29 pm, Aditya Duggal <ad...@gmail.com> wrote:

Hi,

I have tried to understand the developer guide but could not find any guide as to how to apply patches. Basically what I am doing is that I have a set of code running on item codes for item master, now every now and then this file of code is changed to apply new rules to items.

1. Create a /patches folder in your app
2. Add your patch code file there. The patch file must be a python file with a function called "execute"


3. Add the files in the patches.txt file in your repo

Similar to this


Thats it. Your patches will be automatically run when you run latest



The initial practice I do is that I commit my code changes on github and then to check if all items are ok and are within the ambit of the rules in the code, I generally import all items with one field.

Now the problem is that this method of importing all items is very lengthy and cumbersome and hence I was thinking if I could somehow try to make all items get checked through the code via the patches path then it would be great.


–

Note:



If you are posting an issue,


  1. ERPNext is a free and open source software and support is given on this forum by a team (https://frappe.io/webnotes). So please consider donating if you find this forum useful (https://frappe.io/buy). Even a small amount would be helpful.

  2. 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.

  3. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email

  4. 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.

    To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/ebe945db-f562-4d5c-ac97-bbdd09a7d3ed%40googlegroups.com.

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



–

Note:



If you are posting an issue,


  1. ERPNext is a free and open source software and support is given on this forum by a team (https://frappe.io/webnotes). So please consider donating if you find this forum useful (https://frappe.io/buy). Even a small amount would be helpful.

  2. 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.

  3. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email

  4. 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.

    To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/226a36f5-d8f1-47c6-999f-caadbcf522c3%40googlegroups.com.

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


–

Note:



If you are posting an issue,


  1. ERPNext is a free and open source software and support is given on this forum by a team (https://frappe.io/webnotes). So please consider donating if you find this forum useful (https://frappe.io/buy). Even a small amount would be helpful.

  2. 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.

  3. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email

  4. 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.

    To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/90090a0a-37c8-4b14-b6a4-8a43bc8a1855%40googlegroups.com.

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

–

Note:



If you are posting an issue,


  1. ERPNext is a free and open source software and support is given on this forum by a team (https://frappe.io/webnotes). So please consider donating if you find this forum useful (https://frappe.io/buy). Even a small amount would be helpful.

  2. 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.

  3. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email

  4. 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.

To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/8ed031c2-943c-4270-bc5e-cd974ab8c246%40googlegroups.com.

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

–

Note:

 

If you are posting an issue,

 

  1. ERPNext is a free and open source software and support is given on this forum by a team (https://frappe.io/webnotes). So please consider donating if you find this forum useful (https://frappe.io/buy). Even a small amount would be helpful.
  2. 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.
  3. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
  4. 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.

    To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/CAAQzbF1ohRmxX0YTthHn0o%2BZ%2ByXTZY9a%3DQ5NrHSkC9Cwk7qs8g%40mail.gmail.com.

    For more options, visit https://groups.google.com/d/optout.
Hi Anand,

I have a validation code on item master, now every time I change the validation code I would like to know if there are any items which do not satisfy the validation checks.

Now to do this I am trying to create a patch.

The other method is to import all items with a small change and then the validation is done while importing but that is a very tedious task for 9k items.

On Saturday, August 30, 2014 1:10:04 PM UTC+5:30, Anand Doshi wrote:
Hi Aditya,

What exactly are you trying to do?

-Anand.


On Sat, Aug 30, 2014 at 12:58 PM, Aditya Duggal <ad...@gmail.com> wrote:
Hi,

I have just figured out that when I execute the patch then the validation code for that doctype is skipped. Is it possible to invoke the validations during the execution of the patch as I am unable to find a way to invoke validations while executing a patch.


On Saturday, August 30, 2014 12:43:05 PM UTC+5:30, Aditya Duggal wrote:

Hi Anand,


I found a way for the patches. Just enabled developer mode in my local account and gave the admin the rights to delete the patch log items.

Thanks once again for the help.




On Saturday, August 30, 2014 12:28:19 PM UTC+5:30, Aditya Duggal wrote:

Thanks a lot Anand, works fine.


Just wanted to know if I could reset the patch applied since I am kind of testing the application of patch and I am sometimes not aware what results would it bear.


Is it possible to somehow reset the list of patches applied so that I could test my patch files multiple times.

On Saturday, August 30, 2014 11:59:25 AM UTC+5:30, Anand Doshi wrote:
Also in item_master folder

Sent from my phone

On 30-Aug-2014, at 11:40, Aditya Duggal <ad...@gmail.com> wrote:

I am getting this error:


ImportError: No module named patches.item_master.patch_item

Now this is my folder structure: frappe-bench/apps/rigpl-erpnext/rigpl_erpnext/patches/item_master/patch_item.py


Now I have a text file patches.txt in frappe-bench/apps/rigpl-erpnext/rigpl_erpnext

The line mentioned in patches.txt is rigpl_erpnext.patches.item_master.patch_item

Please note the difference in the rigpl-erpnext & rigpl_erpnext folders.

What am I missing?

On Monday, August 25, 2014 3:19:18 PM UTC+5:30, rushabh wrote:

On 25-Aug-2014, at 1:48 pm, Aditya Duggal <ad...@gmail.com> wrote:

Thanks Rushabh,

I am trying the things as I write this post but stumbled upon 2 more things, 

  1. I would like to find and apply patch to those items which are showing in golden color (means items which are not saved), I am unable to find a way to find those items.
there must be some way to find them out! (SQL ?)
  1. Would the patch run every time we do the update of the app

No only once - system keeps track of all patches installed.




On Saturday, August 23, 2014 2:22:22 PM UTC+5:30, rushabh wrote:
On 22-Aug-2014, at 8:29 pm, Aditya Duggal <ad...@gmail.com> wrote:

Hi,

I have tried to understand the developer guide but could not find any guide as to how to apply patches. Basically what I am doing is that I have a set of code running on item codes for item master, now every now and then this file of code is changed to apply new rules to items.

1. Create a /patches folder in your app
2. Add your patch code file there. The patch file must be a python file with a function called "execute" 


3. Add the files in the patches.txt file in your repo

Similar to this


Thats it. Your patches will be automatically run when you run latest



The initial practice I do is that I commit my code changes on github and then to check if all items are ok and are within the ambit of the rules in the code, I generally import all items with one field.

Now the problem is that this method of importing all items is very lengthy and cumbersome and hence I was thinking if I could somehow try to make all items get checked through the code via the patches path then it would be great.


–

Note:

 

If you are posting an issue,

 

  1. ERPNext is a free and open source software and support is given on this forum by a team (https://frappe.io/webnotes). So please consider donating if you find this forum useful (https://frappe.io/buy). Even a small amount would be helpful.

  2. 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.

  3. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email

  4. 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+unsubscr…@googlegroups.com.

    To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/ebe945db-f562-4d5c-ac97-bbdd09a7d3ed%40googlegroups.com.

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



–

Note:

 

If you are posting an issue,

 

  1. ERPNext is a free and open source software and support is given on this forum by a team (https://frappe.io/webnotes). So please consider donating if you find this forum useful (https://frappe.io/buy). Even a small amount would be helpful.

  2. 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.

  3. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email

  4. 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+unsubscr…@googlegroups.com.

    To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/226a36f5-d8f1-47c6-999f-caadbcf522c3%40googlegroups.com.

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


–

Note:

 

If you are posting an issue,

 

  1. ERPNext is a free and open source software and support is given on this forum by a team (https://frappe.io/webnotes). So please consider donating if you find this forum useful (https://frappe.io/buy). Even a small amount would be helpful.

  2. 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.

  3. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email

  4. 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+unsubscr…@googlegroups.com.

    To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/90090a0a-37c8-4b14-b6a4-8a43bc8a1855%40googlegroups.com.

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

–

Note:

 

If you are posting an issue,

 

  1. ERPNext is a free and open source software and support is given on this forum by a team (https://frappe.io/webnotes). So please consider donating if you find this forum useful (https://frappe.io/buy). Even a small amount would be helpful.

  2. 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.

  3. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email

  4. 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.

To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/8ed031c2-943c-4270-bc5e-cd974ab8c246%40googlegroups.com.

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

–

Note:

 

If you are posting an issue,

 

  1. ERPNext is a free and open source software and support is given on this forum by a team (https://frappe.io/webnotes). So please consider donating if you find this forum useful (https://frappe.io/buy). Even a small amount would be helpful.
  2. 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.
  3. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
  4. 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.

    To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/8d5eb300-b9f2-42d2-8741-d04cc2217732%40googlegroups.com.

    For more options, visit https://groups.google.com/d/optout.
Can you share the code? I am not clear on what you are implying by "validation" code. Validation code is called when running "save" or other similar methods or you call it explicitly using doc.run_method("validate")


-Anand.

–

Note:

 

If you are posting an issue,

 

  1. ERPNext is a free and open source software and support is given on this forum by a team (https://frappe.io/webnotes). So please consider donating if you find this forum useful (https://frappe.io/buy). Even a small amount would be helpful.
  2. 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.
  3. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
  4. 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.

    To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/CAAQzbF2QKWyrj7hEaoVnidNv%2BA1vEd5UyqncF%2BMbJGSNLoCtcg%40mail.gmail.com.

    For more options, visit https://groups.google.com/d/optout.
Hi Anand,

I have this custom code running whenever a change on item is made. I would like to check if all items are as per this code, since I make a lot of changes to this code. Now I am finding a faster way to go through this check code and I thought the patch method would be good.

Let me know how could I achieve the same.

On Saturday, August 30, 2014 2:08:52 PM UTC+5:30, Anand Doshi wrote:
Can you share the code? I am not clear on what you are implying by "validation" code. Validation code is called when running "save" or other similar methods or you call it explicitly using doc.run_method("validate")


-Anand.

–

Note:

 

If you are posting an issue,

 

  1. ERPNext is a free and open source software and support is given on this forum by a team (https://frappe.io/webnotes). So please consider donating if you find this forum useful (https://frappe.io/buy). Even a small amount would be helpful.
  2. 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.
  3. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
  4. 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.

    To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/e8402905-2840-4c07-a229-511fc9581f5b%40googlegroups.com.

    For more options, visit https://groups.google.com/d/optout.
Do you want items to rename every time you change the logic?


On 31-Aug-2014, at 10:42 am, Aditya Duggal <ad...@gmail.com> wrote:

Hi Anand,

I have this custom code running whenever a change on item is made. I would like to check if all items are as per this code, since I make a lot of changes to this code. Now I am finding a faster way to go through this check code and I thought the patch method would be good.

Let me know how could I achieve the same.

On Saturday, August 30, 2014 2:08:52 PM UTC+5:30, Anand Doshi wrote:
Can you share the code? I am not clear on what you are implying by "validation" code. Validation code is called when running "save" or other similar methods or you call it explicitly using doc.run_method("validate")


-Anand.


–

Note:

 

If you are posting an issue,

 

  1. ERPNext is a free and open source software and support is given on this forum by a team (https://frappe.io/webnotes). So please consider donating if you find this forum useful (https://frappe.io/buy). Even a small amount would be helpful.
  2. 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.
  3. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
  4. 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.

    To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/e8402905-2840-4c07-a229-511fc9581f5b%40googlegroups.com.

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

–

Note:

 

If you are posting an issue,

 

  1. ERPNext is a free and open source software and support is given on this forum by a team (https://frappe.io/webnotes). So please consider donating if you find this forum useful (https://frappe.io/buy). Even a small amount would be helpful.
  2. 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.
  3. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
  4. 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.

    To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/1D28E8B2-D892-462A-A061-467B2FE044E2%40gmail.com.

    For more options, visit https://groups.google.com/d/optout.
No, I just want the items to be checked if their naming is correct or not according to the code. If there is any error then it should throw an error which could let me know if there is anything wrong with the item code or something is wrong with my code itself.

On Monday, September 1, 2014 11:05:22 AM UTC+5:30, rushabh wrote:
Do you want items to rename every time you change the logic?


On 31-Aug-2014, at 10:42 am, Aditya Duggal <ad...@gmail.com> wrote:

Hi Anand,

I have this custom code running whenever a change on item is made. I would like to check if all items are as per this code, since I make a lot of changes to this code. Now I am finding a faster way to go through this check code and I thought the patch method would be good.

Let me know how could I achieve the same.

On Saturday, August 30, 2014 2:08:52 PM UTC+5:30, Anand Doshi wrote:
Can you share the code? I am not clear on what you are implying by "validation" code. Validation code is called when running "save" or other similar methods or you call it explicitly using doc.run_method("validate")


-Anand.


–

Note:

 

If you are posting an issue,

 

  1. ERPNext is a free and open source software and support is given on this forum by a team (https://frappe.io/webnotes). So please consider donating if you find this forum useful (https://frappe.io/buy). Even a small amount would be helpful.
  2. 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.
  3. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
  4. 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.

    To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/e8402905-2840-4c07-a229-511fc9581f5b%40googlegroups.com.

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

–

Note:

 

If you are posting an issue,

 

  1. ERPNext is a free and open source software and support is given on this forum by a team (https://frappe.io/webnotes). So please consider donating if you find this forum useful (https://frappe.io/buy). Even a small amount would be helpful.
  2. 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.
  3. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
  4. 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.

    To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/28026380-bc0e-47d6-a0be-b2d1293dd87b%40googlegroups.com.

    For more options, visit https://groups.google.com/d/optout.
Now you are getting into test cases :)

https://frappe.io/developers/api/writing-tests

On 01-Sep-2014, at 11:43 pm, Aditya Duggal <ad...@gmail.com> wrote:

No, I just want the items to be checked if their naming is correct or not according to the code. If there is any error then it should throw an error which could let me know if there is anything wrong with the item code or something is wrong with my code itself.

On Monday, September 1, 2014 11:05:22 AM UTC+5:30, rushabh wrote:
Do you want items to rename every time you change the logic?


On 31-Aug-2014, at 10:42 am, Aditya Duggal <ad...@gmail.com> wrote:

Hi Anand,

I have this custom code running whenever a change on item is made. I would like to check if all items are as per this code, since I make a lot of changes to this code. Now I am finding a faster way to go through this check code and I thought the patch method would be good.

Let me know how could I achieve the same.

On Saturday, August 30, 2014 2:08:52 PM UTC+5:30, Anand Doshi wrote:
Can you share the code? I am not clear on what you are implying by "validation" code. Validation code is called when running "save" or other similar methods or you call it explicitly using doc.run_method("validate")


-Anand.


–

Note:

 

If you are posting an issue,

 

  1. ERPNext is a free and open source software and support is given on this forum by a team (https://frappe.io/webnotes). So please consider donating if you find this forum useful (https://frappe.io/buy). Even a small amount would be helpful.
  2. 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.
  3. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
  4. 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.

    To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/e8402905-2840-4c07-a229-511fc9581f5b%40googlegroups.com.

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


–

Note:

 

If you are posting an issue,

 

  1. ERPNext is a free and open source software and support is given on this forum by a team (https://frappe.io/webnotes). So please consider donating if you find this forum useful (https://frappe.io/buy). Even a small amount would be helpful.
  2. 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.
  3. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
  4. 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.

    To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/28026380-bc0e-47d6-a0be-b2d1293dd87b%40googlegroups.com.

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

–

Note:

 

If you are posting an issue,

 

  1. ERPNext is a free and open source software and support is given on this forum by a team (https://frappe.io/webnotes). So please consider donating if you find this forum useful (https://frappe.io/buy). Even a small amount would be helpful.
  2. 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.
  3. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
  4. 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.

    To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/95AD83A9-214B-4020-9C93-192BE5FF53BB%40gmail.com.

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

Hi @rmehta

I am not exactly looking for test cases. Here is a use case which might help you to understand my requirement:

I have a custom field in customer master by the name PAN Number (Permanent Account Number in India)
Now I would like to write a validation script at server end which would validate all new customers’ PAN Number field, the validation would be only allow CAPITAL LETTERS (A-Z) and only allow numbers (0-9) and limit length to 10 digits.

Now this code can be written easily, but my problem is that how should I ensure that the old customer data which was created before this script follow this integrity check.

I hope this would clear up what I am trying to do.

You will have to scrub the data by a patch. Or just write a SQL query in your db to replace, flag entries that are not correct

Hi rmehta,

I added this code to a patch and executed it

The Custom Field was created but somehow when I go to Add New Item, it does not show up.
Do you have any idea what the problem could be ? (Tried with permlevel: 0 as well)