New app for developers - Easy compare fixture (Custom Field / Property Setters)

Hello dear developers,

For those like us, that struggle when doing customization and export them as fixtures in custom app for ERPNext (or other apps) and want what to find easily differences between Custom Field and Property Setters between previous commit and current state, we have a solution.

Use Case :
You are making an app for a customer that add custom fields and change property setters. But you detect that some customization can be migrate in a “common” app for your next customers, because a lots of your customer have the same needs. For example Regional Application. So you’ll probably create a new app and migrate you “common” fixtures to this new one and you’ll probably persists changes in your app with fixtures feature, to be able to deploy it easily without redo always the same work

But as it is going, you have more and Custom Fields in your fixtures, and export after export (probably from different customer environment), when make a git diff on custom_field.json or property_setters.json after your bench export-fixtures, it’s not easy to read because it’s not sorted in the same order as you previous export. So the git diff show you difference where there is no differences in terms of functional data.

Here the magic
In your develop environment in bench folder
bench get-app bench get-app https://github.com/scopen-coop/scopen-frappe-diff.git
then
bench frappe-diff-custom yourappname
The result is a diff.html file is created in folder /app/yourappname/fixtures
just open it in your browser

I can tell you the git diff on this one is really more complex to read

Have fun !

PS: this app is still in development stage, so do not hesitate to participate on Github. We will not fix bugs or features issues at this stage (except the ones we found), but if you’ll able to send PR to fix them, it’s welcome.

3 Likes