Compute history datetime only when invoice has been actually posted
Relying only on the numbered_at being filled make the posting process use the
history data once the number has been set on the invoice. But as the move
computation (with the payment term) happens after, they are done using the
history data (which maybe corrupted see #11980).