summaryrefslogtreecommitdiff
path: root/addons/fetchmail
diff options
context:
space:
mode:
authoruco (OpenERP) <uco@tinyerp.com>2010-12-03 18:14:09 +0530
committeruco (OpenERP) <uco@tinyerp.com>2010-12-03 18:14:09 +0530
commit27360ddd7beb3a4fd7ec7cf2ffbc8c0f24a31dc1 (patch)
treefc5e111d7ccb57e2b41342a30b23128b8b2a7006 /addons/fetchmail
parent061122b7d98ceca2773adcb019b960474841974d (diff)
[FIX] fetchmail: Fixed user problem on email server.
lp bug: https://launchpad.net/bugs/680884 fixed bzr revid: uco@tinyerp.com-20101203124409-qscsum988wvy9hxj
Diffstat (limited to 'addons/fetchmail')
-rw-r--r--addons/fetchmail/fetchmail.py5
-rw-r--r--addons/fetchmail/fetchmail_view.xml1
2 files changed, 4 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]})
diff --git a/addons/fetchmail/fetchmail_view.xml b/addons/fetchmail/fetchmail_view.xml
index ecdb4acfb3b..394761c09df 100644
--- a/addons/fetchmail/fetchmail_view.xml
+++ b/addons/fetchmail/fetchmail_view.xml
@@ -48,6 +48,7 @@
<group col="2" colspan="2">
<separator string="Auto Reply?" colspan="2"/>
<field name="action_id"/>
+ <field name="user_id"/>
</group>
<group col="2" colspan="2">
<separator string="Process Parameter" colspan="2"/>