def METHOD_NAME(self):
    self.ensure_one()
    if self.state == "pendente":
        self.action_ciencia_emissao()
    try:
        document = self.dfe_id._download_document(self.key)
        document_id = self.dfe_id._parse_xml_document(document)
    except Exception as e:
        self.dfe_id.message_post(body=_("Error importing document: \n\n %s") % e)
        return
    if document_id:
        document_id.dfe_id = self.dfe_id.id
        self.document_id = document_id