[FIX] product: avoid duplicates in name search
[FIX] product: avoid duplicates in name search

A typo probably introduced during the migration to the new api may have
caused duplicates to appear in the name search results since it added
the ids of the wrong recordset.

The previous fix, while effective, also removed a previous optimization
for databases with a lot of products. While the code may seem obscure
on first read, the comments should shed some light on the
implementation choice.

This commit therefore reintroduce the previous code with the exception
of the call to the wrong recordset (self instead of products).

Amends b02a85f
Courtesy of @rco-odoo

dfang/odoo,hip-odoo/odoo,hip-odoo/odoo,hip-odoo/odoo,dfang/odoo,ygol/odoo,hip-odoo/odoo,dfang/odoo,ygol/odoo,ygol/odoo,ygol/odoo,dfang/odoo,dfang/odoo,hip-odoo/odoo,ygol/odoo,ygol/odoo,ygol/odoo,dfang/odoo,hip-odoo/odoo