We used “Custom Field” and “Custom Script” to modify a few forms. The custom field did not respond to our entry in “Insert After” during creation; the field was found at the bottom of the target DocType so we dragged the field into place in “Customise Form”. Then, we updated bench in the server using “bench update” and found that our customised forms were rearranged. The fields took their default positions and all the custom fields were sent to the bottom of the page. How can we address this issue?We want custom fields and relocated default fields to maintain their position after updates.
Get fixtures of Property Setter.
To retrieve fixtures put
fixtures = [‘Property Setter’] in custom app’s hooks.py file.
Hi, i apprecuate that somebody is answering this long outstanding issue, but can we have some common person’s (non developer) explanation of a fix for this?
@Rohit, thanks for your response! The rearrangement of the forms was done in ERPNext so we tried to add the line you suggested to ./frappe-bench/apps/erpnext/erpnext/hooks.py. Unfortunately, there was no change; the custom fields continue to remain at the bottom of the page.
After adding fixtures = [‘Property Setter’] in hooks.py file, have you run command bench export-fixtures? If no then run this command and then run bench update command
@Rohit, thanks again. We just tried that but there is still no change to the forms.
Check the below steps once again.
- Relocate the custom fields using customize form.
- In app’s hooks.py file put fixtures = [‘Property Setter’]
- Run command bench use your_site_name and bench export-fixtures, after this system will make property_setter.json file under location /frappe-bench/erpnext/erpnext/fixtures/property_setter.json.
- Update your setup using bench update command.
- if still it’s not work then run bench migrate command.
@rohit_w, it only works if the Property Setters are generated after the update!
@Ashutosh_Prasad, for now do you need reorganize again the fields, and for prevent it in the next updates, use the suggested method by @rohit_w
@Ashutosh_Prasad, dont forget of keep your changes in your app!
Thanks Its Working