Problem
-------
_search_is_mail_thread_sms is looking for ir.model
in the database and then fetch them from the registry
without verification. This can lead to key error
when a model is present in the database but not in
the python anymore. This situation can happen
after a migration.
Solution
--------
Check the model is present in the registry
closesodoo/odoo#60001
X-original-commit: 448626d86a1f06b9f8a7a88111f7cb01600488cd
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>