Relation between the optical potential for spherical and deformed nuclei