Packaging print format as fixture

I am trying to package a custom print format as fixture so I added fixtures = [“Custom Field”, “Print Format”] in hooks.py. It works but the file fixtures/print_format.json comes populated with other print formats I don’t want. Is there a way to avoid this?

1 Like

Just delete them from the file…

Hi @RWEMA_Aimable,

You can manually delete the fixtures from file as @Ben_Cornwell_Mott suggested or You can use the filters in the fixtures,

please check the following syntax for adding filters in Fixtures

fixtures = ["Custom Field", {
	"doctype": "Print Format",
	"filters":	{
		"name": ["in", "Custom Sales Invoice Print Format"]
	}
}]

In this case, you will get only print formats those are mentioned in the filters.

Thanks, Makarand

2 Likes

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.