NXP-14543: fix query to retrieve templates automatically associated to a document type