Hi everyone,
bench version 5.0.0
frappe version 12.11.0
erpnext version 12.13.0
Recently I just found out an issue with migrating using property setter in fixture in custom app.
Let me use an example to explain the issue as the subject stated.
- I need to hide the shipping_rule link field for sales invoice DocType. So I did that change on Customize Form, tick the checkbox “Hidden” for shipping_rule and update.
- In “Property Setter” List, I can see a document named “Sales Invoice-shipping_rule-hidden”, and the set_value is “1”.
- I can also see the JSON is written in property_setter.json in my custom app.
- Then if I commit the changes in my dev app and deploy to my live app, then bench migrates runs great, it will tick the hidden checkbox for my live app.
However, if I decided that I need to undo that customization, I untick the hidden checkbox in my dev app and click updates. When I run bench export-fixtures
, it will delete the JSON part.
As you guess it, when I commit the changes from dev to live, the live site didn’t update/reflect this change on live site. I know for performance reasons, ERPNext will not go through all the customize fields the site currently has, so it only goes through the ones recorded in JSON files in fixture folder.
I also know to a workaround which is just manually find the JSON and change the value to “0” so the live site will update correctly. But If I have a lot of custom fileds and property setter changes, it would be hard for me to manually go through these changes.
I know this might not be a very serious bug, but would be good if we can have a way to prevent this so that it’s more friendly for developers. Or if you have any ideas or comments, please let me know.
Thank you very much!