This commit fixes the visitor's time_statistics computation. When creating a
new visitor, last connection datetime is not set, so it's not retrieved in the
search_read and crash at search_read_result[visitor.id].
This fix also speeds up and simplifies the time_statistics computation.
As time_connection_datetime is always set (for already created visitor) and in
the depends, no need to read values before looping, the data is already fetched
in memory. We can then use directly the value for each visitor in self.
Task ID: 2120464
PR #40199closesodoo/odoo#43780
X-original-commit: 1f0c9f272ea5b6b7b891fcb8d00eb81e7fe33f81
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>