[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.
This makes sure it is always called when a stock.move is
processed, even without going through the partial picking wizard.

Fixes #2991
Closes #3949
OPW-615491
[ADD] purchase: average price computation test
Merge branch '7.0' of https://github.com/odoo/odoo into 7.0-linux64