Fix relation between invoice lines and stock moves in partial delivery

issue4003
review9691002
(grafted from e3a0c9ff9190a68650bf3613e762a0beaa4d9825)

--HG--
branch : 3.2
extra : source : e3a0c9ff9190a68650bf3613e762a0beaa4d9825