Autoname for BOM not working

Hello,

I’ve had an autoname function defined in my custom app for BOM for a while now. But after the most recent update, the custom autoname function isn’t working. The BOM is instead using the autoname function that is defined in the bom.py file. Please help.

ERPNext: v12.1.8 (version-12)
Frappe Framework: v12.0.18 (version-12)

Thanks,
Ishan