This question is almost a duplicate of this one. Except the answer does not work for the spanish language.
You can check by commenting/removing the 2nd and 3rd lines.
\documentclass[numbers=noenddot]{scrbook}
\def\spanishoptions{mexico}
\usepackage[spanish]{babel}
\usepackage{blindtext}% dummy text
\begin{document}
\tableofcontents
\part{One}
\part{Two}
\blinddocument
\end{document}
