[FIX] mass_mailing: fix performance issue on the "total" field
[FIX] mass_mailing: fix performance issue on the "total" field

Issue
=====
There's a performance issue when computing the total field on the
mailing model. When there're a lot of record (e.g. 500.000 leads).

This is because when we compute the field, we are fetching all the
records and then we calculate the length of the array.

We can just use a `search_count` and let Postgre count the records.

Task-2313123

closes odoo/odoo#56293

X-original-commit: d1ab37de0c4782b4f12b44f9858446b4c9c7dc08
Signed-off-by: Thibault Delavallee (tde) <2d325771bb6e8870d87f0f3f7b45589a8338e550@openerp.com>

ygol/odoo,ygol/odoo,ygol/odoo,ygol/odoo,ygol/odoo,ygol/odoo,ygol/odoo