summaryrefslogtreecommitdiff
path: root/addons
diff options
context:
space:
mode:
authorMantavya Gajjar <mga@tinyerp.com>2010-04-27 20:14:13 +0530
committerMantavya Gajjar <mga@tinyerp.com>2010-04-27 20:14:13 +0530
commit98df501e00ee3ced050cef92633ecc2eb683db5c (patch)
treedae5f627fcee0b68e3f24d7aa4308859afff93bd /addons
parentd754240f973617b1b3db88cd29a8655f5e0cd1d7 (diff)
[IMP]: improvement in fetchmail module
bzr revid: mga@tinyerp.com-20100427144413-1y5w8db8g1ovy7uu
Diffstat (limited to 'addons')
-rw-r--r--addons/fetchmail/fetchmail.py13
-rw-r--r--addons/fetchmail/fetchmail_view.xml3
2 files changed, 11 insertions, 5 deletions
diff --git a/addons/fetchmail/fetchmail.py b/addons/fetchmail/fetchmail.py
index 32b4ade2d27..3639decf3dc 100644
--- a/addons/fetchmail/fetchmail.py
+++ b/addons/fetchmail/fetchmail.py
@@ -321,10 +321,15 @@ class email_server(osv.osv):
his_id = history_pool.create(cr, uid, res)
return res_id
-
- def __fetch_mail(self, cr, uid, ids, context={}):
- sendmail_thread = threading.Thread(target=self.fetch_mail, args=(cr, uid, ids))
- sendmail_thread.start()
+
+ def set_draft(self, cr, uid, ids, context={}):
+ self.write(cr, uid, ids , {'state':'draft'})
+ return True
+
+ def button_fetch_mail(self, cr, uid, ids, context={}):
+ self.fetch_mail(cr, uid, ids)
+# sendmail_thread = threading.Thread(target=self.fetch_mail, args=(cr, uid, ids))
+# sendmail_thread.start()
return True
def _fetch_mails(self, cr, uid, ids=False, context={}):
diff --git a/addons/fetchmail/fetchmail_view.xml b/addons/fetchmail/fetchmail_view.xml
index d457f9636f1..ea08706b62d 100644
--- a/addons/fetchmail/fetchmail_view.xml
+++ b/addons/fetchmail/fetchmail_view.xml
@@ -58,7 +58,8 @@
</notebook>
<group col="6" colspan="4">
<field name="state" select="1"/>
- <button string="Fetch Emails" type="object" name="__fetch_mail"/>
+ <button string="Fetch Emails" type="object" name="button_fetch_mail"/>
+ <button string="Set to Draft" type="object" name="set_draft"/>
</group>
</form>
</field>