[IMP] stock: do not generate empty backorders

If every line of a partial delivery is at zero, do not generate empty backorders (opw 608680)
[FIX] crm: correct open lead or opportunity view from calls

When opening a lead/opportunity from the phonecalls view, we did not open the correct view (always the lead).
This will use the type of the crm.lead to determine which view should be used, opw 608493.
[IMP] stock: Optimize stock_move.setlast_tracking()

When setlast_tracking is called on a large number of moves in a picking
(e.g.  when splitting moves in a picking), the time to complete grows
exponentially.  The reason is that it loops over all the moves of
a picking, even if it keeps only the last tracking.

The method now uses a search() with a limit so it doesn't need to browse
all the moves.

Added test to check the behaviour of setlast_tracking
Fixes #2448
[INP] portal_sale: remove buggy context

Even if this should never be used in normal portal environment, if a user with enough access rights tries to create an invoice, this would crash. We don't need context here (opw 612591).
Forward port of branch 7.0 up to 1933e92
[IMP] crm: remove TODO posted by past me