A generalization of the Barban–Davenport–Halberstam Theorem to number fields