I want to prove the following
Every $A$-module is projective if and only if $A$ is a finite direct product of fields.
I know a relevant result: Every ideal of a ring $A$ is generated by an idempotent if and only if $A$ is a finite direct of fields.
Thus it reduces to prove that:
Every $A$-module is projective if and only if every ideal of a ring $A$ is generated by an idempotent.
Assuming LHS of above, for any ideal $I$ of A, $A/I$ is projective as $A$ module hence flat as $A$ module, implying that $I=I^{2}$. How can I complete it ?