Where is the condition for saving Purchase Receipt?

if when creating a new Item put a check INSPECTION CRITERIA,
then when saving a new Purchase Receipt message appears - “Create Quality Inspection for Item”

in which file the condition is checked that the corresponding document “Quality Inspection” is created ?

This search example should help -

frappe@ubuntu1804lts:~/frappe-bench$ find . -name *.py | xargs grep 'Create Quality Inspection for Item'
./apps/erpnext/erpnext/controllers/stock_controller.py:					frappe.msgprint(_("Create Quality Inspection for Item {0}").format(frappe.bold(d.item_code)))

Thank yuo very match!