Right way to add a field to Sales Invoice

Hi,
I am wondering what is the right way to add a custom field to doctype like Sales Invoice. I have added two fields to ‘Sales Invoice’ using ‘Customize Form’. I was following some old threads which suggested to run ‘bench --site mysite export-fixtures’. That has created web_form.json under erpnext/fixtuers. The new fields are working fine, however the fixtures file is preventing me from doing a ‘bench update’. I am not sure ignoring it is the right way as I wanted to follow a standard procedure for minor customizations. Can someone tell me what I should have done differently to allow seamless upgrades?

You can git clean -f -d and run the update - your custom fields should be safe in the database. You really didn’t have to export fixtures, I guess fixtures are only helpful to get the custom fields packed into an app or to import it in another site.

Hope this helps.

2 Likes

Thanks @akurungadam, I did a bench update --reset’ and the custom fields are still there. Exporting them to an app sounds like a good idea. I will perhaps give it a try sometime in future…