[FIX] mail: model can be None or uninstalled

This is related to rev. 83b28737e9
This commit is contained in:
Denis Ledoux 2014-12-02 16:50:15 +01:00
parent 8c8056d95f
commit 2592f149a0
1 changed files with 1 additions and 1 deletions

View File

@ -73,7 +73,7 @@ class mail_compose_message(osv.TransientModel):
result['res_id'] = result.get('res_id', context.get('active_id'))
result['parent_id'] = result.get('parent_id', context.get('message_id'))
if not hasattr(self.pool[result['model']], 'message_post'):
if not result['model'] or not self.pool.get(result['model']) or not hasattr(self.pool[result['model']], 'message_post'):
result['no_auto_thread'] = True
# default values according to composition mode - NOTE: reply is deprecated, fall back on comment