Importing fixtures from custom app

When installing my custom app I get the error
“frappe.exceptions.ValidationError: Options must be a valid DocType for field CustomDocType in row 6”

I think it’s because I reference this CustomDocType from a custom table field. But the DocType doesn’t exist when importing the fixtures from custom_field.json because doctype.json is listed alphabetically after that.

So the whole installation stops there and my custom fields aren’t generated nor are my custom DocTypes or translations.

What to do?


I tried working around this for now by just migrating doctype.json and then the other json files. But on migrate I get the error: “frappe.exceptions.MandatoryError: Enter at least one permission row”
Altough both my custom DocTypes are marked as “istable”, so I cannot set permissions for them.

Anyone else having these problems?


Does atleast someone know where else I could get the information?
On another board or something?

by any chance did you directly edit json files while making your custom app ?

No, I just used “bench export-fixtures”.

I really think it’s because when it’s importing my custom_field child-table with option CustomDocType it tries to validate the DocType, but it isn’t yet imported from the doctype.json file. But why the validation while importing, if DocTypes are imported after the costum fields?


Would it be of any use, if I’d edit the json files manually?
Why shouldn’t I do it? Is this breaking some formatting needed while importing?

Where could I hire a developer that can support me with this issue?

You can post your requirements in
you can contact any Service Providers from the listing

I fixed the issue.

The problem was that I was exporting doctype.json as a fixture for exporting my custom DocTypes.
Instead I should have copied the files that are created in apps/myapp/myapp/mymodule/doctype/mydoctype/.

Same for reports btw. I also exported report.json as a fixture. Not doing this anymore now.
The only fixture I have now is custom_field.json.

All other errors I had while trying to work around this issue are all based on the wrong export method for DocTypes.