Export of Form Customizations

Hello,
I want to know what is the best practice to export forms customizations (fields added, changes of labels, etc) to a custom app.

My use case is the following:
I have two custom apps which have customizations in the Sales Invoice form, these apps are independent of each other so I can install one, another or both in a site.

In my development environment, I have a site for each app and I exported the changes made in the Sales Invoice form with Customize Form (Sales Invoice) > Export Customizations > My custom app, so in each app, I have a sales_invoice.js inside the “custom” folder.

The problem is when I want to install both apps on a Site, the second app installed override and discard the customizations of the first app.

I read that I can add “Custom Field” in hooks in order to export the customizations in a fixture, but this procedure will create a .json with the custom fields of all the apps I have on my bench, so if for example, I install only one of my custom apps this will add the customizations of the another app which isn’t the desired behaviour.

There is a way to achieve this or I missing something?

The only thing that came to my mind is to have one bench for each custom app in order to do the fixture but isn’t very practical approach.

Hope I have explained myself.

Regards.

In hooks use filters along with fixtures.

check Fixtures Support - filters

2 Likes

Thanks! I will check this.