Doctype event_doc insert event not working

hello, i could not use doc events to hook Serial No doctype insert event, so later after i did some inspection i found that when creating purchase receipt with Serial No the serial_no.py uses db_insert api to insert the data which will not trigger any doc event, So how i can hook this or know when a new record is inserted with python ?

reference:
serial_no.py line: 665 to 668