I am reading Chapter 15 (page 319) of Cox's Book Primes of the Form $x^2+ny^2$. Given $K$ a quadratic field and $O$ an order of $K$, he defines the ring of $O$-adeles as $\hat O=O\otimes_{\mathbb Z}\hat {\mathbb Z} $ where $\hat{\mathbb Z}=\prod_p\mathbb Z_p$.
He says: since $O$ is a free $\mathbb Z$-module we have $\hat O=\prod_pO_p$ where $O_p=O\otimes_{\mathbb Z}\mathbb Z_p$.
I know the very basic stuff on tensor products, i.e. that tensor product preserves direct sums and that $\mathbb Z\otimes_{\mathbb Z} M=M$, but I can't explain his statement since I don't know how tensor product works with infinite products for example and how to use that $O$ is a free $\mathbb Z$-module.