Restrict to do Quality Inspections of items based on Condition

Hello Community!!
I need to restrict to do quality inspections for items having specific item group.

Can anyone suggest steps to do this?

Override the core js function (make_quality_inspection).