summaryrefslogtreecommitdiff
path: root/addons/fetchmail/fetchmail.py
diff options
context:
space:
mode:
Diffstat (limited to 'addons/fetchmail/fetchmail.py')
-rw-r--r--addons/fetchmail/fetchmail.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/addons/fetchmail/fetchmail.py b/addons/fetchmail/fetchmail.py
index 772771db915..a1209492490 100644
--- a/addons/fetchmail/fetchmail.py
+++ b/addons/fetchmail/fetchmail.py
@@ -84,9 +84,11 @@ class email_server(osv.osv):
def check_model(self, cr, uid, ids, context = None):
if context is None:
context = {}
- current_rec = self.read(cr, uid, ids, context)[0]
+ current_rec = self.read(cr, uid, ids, context)
if current_rec:
- model = self.pool.get(current_rec.get('object_id')[1])
+ current_rec = current_rec[0]
+ model_name = self.pool.get('ir.model').browse(cr, uid, current_rec.get('object_id')[0]).model
+ model = self.pool.get(model_name)
if hasattr(model, 'message_new'):
return True
return False