Here is from Vakil's FOAG,Exercise 13.1.M,part (d),page 374:
where $K$ is a number field and $\mathcal O_K$ is the ring of integers in $K$.The main difficulty is to show that every invertible sheaf on $Spec\mathcal O_K$ comes from certain fractional ideal. My thought is using the structure theorem for f.g. module over Dedekind domain.But I don't know if it is necessary to quote such a theorem.So can you give me some hints?