summaryrefslogtreecommitdiff
path: root/addons/fetchmail/fetchmail.py
diff options
context:
space:
mode:
authorjam-openerp <jam@tinyerp.com>2010-12-07 11:05:56 +0530
committerjam-openerp <jam@tinyerp.com>2010-12-07 11:05:56 +0530
commit241da980f97bc654c0ab3fd86974ea2dd343c7de (patch)
tree098eaf3c393a6fc416fb7d713e88abe2e927e91a /addons/fetchmail/fetchmail.py
parent4034e156aff3a428c322d99d27607498781b01ad (diff)
parenta1e90448f6e393b517420572251cd2304aadc91c (diff)
[MERGE]
bzr revid: jam@tinyerp.com-20101207053556-1a5y9amunau6lz1r
Diffstat (limited to 'addons/fetchmail/fetchmail.py')
-rw-r--r--addons/fetchmail/fetchmail.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/addons/fetchmail/fetchmail.py b/addons/fetchmail/fetchmail.py
index 77748adf017..84490de2b53 100644
--- a/addons/fetchmail/fetchmail.py
+++ b/addons/fetchmail/fetchmail.py
@@ -150,6 +150,7 @@ class email_server(osv.osv):
context.update({'get_server': True})
for server in self.browse(cr, uid, ids, context):
count = 0
+ user = server.user_id.id or uid
try:
if server.type == 'imap':
imap_server = self.button_confirm_login(cr, uid, [server.id], context=context)
@@ -157,7 +158,7 @@ class email_server(osv.osv):
result, data = imap_server.search(None, '(UNSEEN)')
for num in data[0].split():
result, data = imap_server.fetch(num, '(RFC822)')
- res_id = email_tool.process_email(cr, uid, server.object_id.model, data[0][1], attach=server.attach, context=context)
+ res_id = email_tool.process_email(cr, user, server.object_id.model, data[0][1], attach=server.attach, context=context)
if res_id and server.action_id:
action_pool.run(cr, uid, [server.action_id.id], {'active_id': res_id, 'active_ids':[res_id]})
@@ -174,7 +175,7 @@ class email_server(osv.osv):
for num in range(1, numMsgs + 1):
(header, msges, octets) = pop_server.retr(num)
msg = '\n'.join(msges)
- res_id = email_tool.process_email(cr, uid, server.object_id.model, msg, attach=server.attach, context=context)
+ res_id = email_tool.process_email(cr, user, server.object_id.model, msg, attach=server.attach, context=context)
if res_id and server.action_id:
action_pool.run(cr, uid, [server.action_id.id], {'active_id': res_id, 'active_ids':[res_id]})