How to push custom fields to standard doctypes in target App?

I want to push custom fields to Standard doctypes of erpnext from a custom app.

I create new site with new custom app without ERPNext.

And trying to add custom fields but the problem is how i can map it to ERPNext document and it is not there?

I feel I am doing something wrong.

If so please guide me with full details of how to add custom field as Fixtures and export it to target App.

Regards,
Mohammed Redha

You need to add the fixtures = {“Custom Field”} line to your hooks.py file, then you just use the bench export-fixtures command with your app loaded. It will create a Fixtures folder in your app with a json file containing all the custom fields.

There are quite a few topics in the forum discussing this.

the fixtures in hooks should be in the List instead of dictionary.

fixtures = ["Custom Field"]

1 Like

I guess you did not search the forums before posting this topic:

@Ben_Cornwell_Mott Thanks for your reply but I dont get details steps of doing that?

let’s assume I have “ERPNext” APP and want to add custom fields and custom script and filters and I want to hold these changes to App called “Custom” .

where should I make the changes? in “ERPNext” app or “Custom” app?
where I should put fixtures = ["Custom Field"]? which hooks.py APP? in “ERPNext” app or “Custom” app?

@adityaduggal I make search but the thread was closed and I want more details steps of doing that

The hooks.py would be the hooks of your APP and should look something like:

app_name = "rigpl_erpnext"
app_title = "Rohit ERPNext Extensions"
app_publisher = "Rohit Industries Ltd."
app_description = "Rohit ERPNext Extensions"
app_icon = "icon-paper-clip"
app_color = "#007AFF"
app_email = ""
app_url = "https://github.com/adityaduggal/custom_erpnext"
app_version = "0.0.1"
fixtures = ["Custom Field","Custom Script"]
hide_in_installer = True

Then create a folder fixtures in your app with a file as custom_field.csv with all the details of your CSV.
If you have a doubt as to where the folder should be just have a look at my custom app and try to analyse that

1 Like

Hi @Mohammed_Redha,

You should add fixtures = ["Custom Field"] in your custom app’s hooks.py if custom app is available.

No need to create fixtures directory manually, just use the command export-fixtures It will create the fixtures folder and the Custom Field.csv

e.g. bench export-fixtures

Thanks, Makarand

1 Like