Adding standard records for new DocType

I’m trying to figure out how to add standard records for a new doctype I’m creating. If this was for a custom app, I think I’d know how to do it, but since I’m writing it for the core, I’m a bit confused as to what to do.

Here’s a sample of the list of records I want to add:

install_docs = [
	{"min_grade":0.0,"name":"Very Poor","prevent_rfqs":1,"notify_supplier":0,"doctype":"Supplier Scorecard Standing","max_grade":30.0,"prevent_pos":1,"standing_color":"Red","notify_employee":0,"standing_name":"Very Poor"},
	{"min_grade":30.0,"name":"Poor","prevent_rfqs":1,"notify_supplier":0,"doctype":"Supplier Scorecard Standing","max_grade":50.0,"prevent_pos":0,"standing_color":"Red","notify_employee":0,"standing_name":"Poor"},
	{"min_grade":50.0,"name":"Average","prevent_rfqs":0,"notify_supplier":0,"doctype":"Supplier Scorecard Standing","max_grade":80.0,"prevent_pos":0,"standing_color":"Green","notify_employee":0,"standing_name":"Average"},
	{"min_grade":80.0,"name":"Excellent","prevent_rfqs":0,"notify_supplier":0,"doctype":"Supplier Scorecard Standing","max_grade":100.0,"prevent_pos":0,"standing_color":"Blue","notify_employee":0,"standing_name":"Excellent"},
	
]

I’ve noticed that some records seem to be added this way from the init.py for the module:

I’ve tried this and it doesn’t seem to work. I know that frappe and ERPNext do this all the time (creating new Roles, for example), but I can’t figure out how this is done. Any hints would be really helpful.

You can use the after_install hook to install your docs when your app is installed. For existing users, you can write a patch to call the method

https://frappe.github.io/frappe/user/en/guides/deployment/migrations