Added signal emited then the type is changed, added Document model method to update the document type