7.0 stock fixes jle

* [FIX] stock: compute average price on action_done
the average price computation is now deduplicated and moved to
a separate function called in stock_move action_done.

* [ADD] purchase: average price computation test

fixes #2991
opw-615491