Browse Source

Update __init__

pull/292/head
Carlos Almeida 9 years ago
parent
commit
d0ed5c2956
  1. 6
      web_fetchmail_no_followers/model/mail_thread.py

6
web_fetchmail_no_followers/model/mail_thread.py

@ -48,13 +48,9 @@ def MailNoFollowersMessagePost(self, cr, uid, thread_id, body='', subject=None,
class MailNoFollowers(models.Model):
''' I define this class so this code will be executed only if module
is installed in database. Otherwise it will be always executed.
Odoo call __init__ once on install and once on uninstall.
This way we switch to standard method without a server restart.
'''
_name = 'mail.thread'
def __init__(self, *arg, **kwargs):
if mail_thread.message_post == message_post_super:
mail_thread.message_post = MailNoFollowersMessagePost
else:
mail_thread.message_post = message_post_super
mail_thread.message_post = MailNoFollowersMessagePost
Loading…
Cancel
Save