summaryrefslogtreecommitdiff
path: root/addons/fetchmail/fetchmail.py
diff options
context:
space:
mode:
authoruco (OpenERP) <uco@tinyerp.com>2010-12-30 11:37:53 +0530
committeruco (OpenERP) <uco@tinyerp.com>2010-12-30 11:37:53 +0530
commite0416f8a8fb82174fdaafdbf4bb6dfced55a2b04 (patch)
tree5d46c1dd0eb72bf230a4bcbf9d7980ada4c8fd51 /addons/fetchmail/fetchmail.py
parentc3098f4f437708c7b2d6d4a52cd02950c5b67f31 (diff)
parentb352cf0e20d1e17f4cdbd93c3c388fc0004ea50a (diff)
[MERGE]
bzr revid: uco@tinyerp.com-20101230060753-wujam7otb5f13f0z
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