This question has been flagged
11 Replies
49153 Views

Is there a Way to stop OpenERP from automatically adding followers to documents like projects and opportunities if they are just partners (Clients or Suppliers) but no internal OpenERP users?

The problem is that a lot of time we do write an initial E-mail to our client - this almost every time adds him automatically as a follower. Then you have to remove him again to make sure that no unwanted E-mails are send to the Partner.

If i could add a rule that partners are never automatically added as followers but only system users i would clearly avoid a lot "unwanted" E-Mails. But still be able to internally inform all important ERP users.

Any suggestion is welcome!

Avatar
Discard
Author

Tried to find a "rule" for it but did find nothing?!?

Any ideas on how to achieve this? Do you receive an answer Michael?

Author

No still no answer and nothing else found on the internet - Please vote for this question so it may get the attention of openerp

This is huge! Please fix.

We just startet with OpenERP and today the same problem popped up today I worked on a task regarding a fair in January which we wanted to attend. I wrote an eMail to Florian as I know that he knows the right people to talk to. Later I wrote another message to Ali and asked him a questions on the fair. Unfortunately this message has also been sent to Florian as he has automatically been added as a follower.

How to do it in Odoo 15?

Author Best Answer

I will Upload our module soon to Github if anyone is still in need of this functionality. We also created a Global BCC Mdoule to BCC the E-Mails generated by OpenERP to our own E-Mail Server for Archiving Searching and Backup. - Still i do feel that the E-Mail integration in OpenERP is just not really well done / ready enough for real life scenarios.

Please find our Modules at:

https://github.com/OpenAT/odoo-addons/tree/7.0

Look for chatterimprovements and mayby globalbcc could be handy also.
 

Still i would like to ask you if there are other interested in taking the chatter module some steps further like:

  • CK Editor
  • Zimbra or other Mail integration (like having mails in both worlds)
  • Move Mails or "full conversations" between Objects in case of wrong assignment in the first place
  • Full Text E-Mail search
  • Add Attachments from existing Documents and possible from OWN Cloud
  • Drag and Drop Attachments to Messages
  • Make it possilbe to select and deselect recipients when sending mails no matter if they are followers or not!

Is anyone interrested in joining Forces on one or more of these topics?

Avatar
Discard

I would really like this Michael. Under which name it is going to be uploaded?

Where can I find your Github repo? It should be nice to probe your modules

Hello Michael, We're about to start developing such funcionality. Are you going to share the module you mention?

Hello Michael, is there a version of your module that works with Odoo 8?

Best Answer

This behavious is actually generating many issues. On my side, i have changed the file mail_thread.py from this :

    # automatically subscribe recipients if asked to
    if context.get('mail_post_autofollow') and thread_id and partner_ids:
        partner_to_subscribe = partner_ids
        if context.get('mail_post_autofollow_partner_ids'):
            partner_to_subscribe = filter(lambda item: item in context.get('mail_post_autofollow_partner_ids'), partner_ids)
        self.message_subscribe(cr, uid, [thread_id], list(partner_to_subscribe), context=context)

to this :

        # automatically subscribe recipients if asked to
    #if context.get('mail_post_autofollow') and thread_id and partner_ids:
    #    partner_to_subscribe = partner_ids
    #    if context.get('mail_post_autofollow_partner_ids'):
    #        partner_to_subscribe = filter(lambda item: item in context.get('mail_post_autofollow_partner_ids'), partner_ids)
    #    self.message_subscribe(cr, uid, [thread_id], list(partner_to_subscribe), context=context)

Now adding automatically follower is disabled.

++

Julien

Avatar
Discard

I tried your solution and it works for the first test. How do you make the solution permanent against a "git pull" ? Is "git rm mail_thread.py" enough?

Could somebody please Show, how this working solution could also be applied to the mail_group.py=discussion groups?

Is this code for 7.0 or 8.0? I'm looking for a solution for Odoo 8.

Best Answer

Hello everyone!

I am here with an answer.

I had same problem on Odoo 14 and strugled a lot to deal with it.

What woked for me was this:

Basicaly, all models that inherrit mail.thread have access to this method so by overriding it you can add custom behaviour after mesage was posted.

I hope this helps someone.

def _message_post_after_hook(self, message, msg_vals):
res = super(CrmLead, self)._message_post_after_hook(message, msg_vals)
for this in self:
for follower in this.message_follower_ids:
follower.unlink()
return res
Avatar
Discard
Best Answer

Is there a way to achieve this within Odoo 8 without hacking into the code and thus making the change stable and persistent? I cannot think of a situation where I would want the Customer or "Patner" to be privy to our internal communications by default. Whoever thought that this was a good idea is mistaken.

Avatar
Discard

Victor, did you find a solution?

Best Answer

Ray buy "check out" do you mean mute these functions? or study them?

Something like this would work?

from openerp.osv import osv, fields

class mail_followers(osv.Model):
_inherit = 'mail.followers'
def get_partners_to_email(self, cr, uid, ids, message, context=None):
pass


class mail_thread(osv.AbstractModel):
_inherit = 'mail.thread'
def message_get_suggested_recipients(self, cr, uid, ids, context=None):
pass


class crm_lead(format_address, osv.osv):
_inherit = 'crm.lead'
def message_get_suggested_recipients(self, cr, uid, ids, context=None):
pass


class project_issue(osv.Model):
_inherit = "project.issue"
def message_get_suggested_recipients(self, cr, uid, ids, context=None):
pass

Avatar
Discard

The intention was to put this as a comment, not an answer. Sorry.

Best Answer

For 8.0 Community Users the easiest way to achieve this behavior is by using the edit suggested by Julien Rey above:

Locate Mail_thread.py @ C:\Program Files (x86)\Odoo 8.0\server\openerp\addons\mail.

Locate this code (Line 1677):

 # automatically subscribe recipients if asked to
    if context.get('mail_post_autofollow') and thread_id and partner_ids:
        partner_to_subscribe = partner_ids
        if context.get('mail_post_autofollow_partner_ids'):
            partner_to_subscribe = filter(lambda item: item in context.get('mail_post_autofollow_partner_ids'), partner_ids)
        self.message_subscribe(cr, uid, [thread_id], list(partner_to_subscribe), context=context)

Then comment out the 5 lines beneath so it looks like this:

       # automatically subscribe recipients if asked to
    #if context.get('mail_post_autofollow') and thread_id and partner_ids:
    #    partner_to_subscribe = partner_ids
    #    if context.get('mail_post_autofollow_partner_ids'):
    #        partner_to_subscribe = filter(lambda item: item in context.get('mail_post_autofollow_partner_ids'), partner_ids)
    #    self.message_subscribe(cr, uid, [thread_id], list(partner_to_subscribe), context=context)

In addition to this change, the module made by Smile, ( https://apps.openerp.com/apps/modules/8.0/smile_followers/ ), prevents the creators of events like quotes being added to the 'Followers' List.

Avatar
Discard
Best Answer

Have a look at this module: https://apps.odoo.com/apps/modules/9.0/compoze_no_auto_subscribe/. It may be really comfortable to use to that purposes

Avatar
Discard
Best Answer

For Sale order i get to know that in action_button_confirm method code is there to manually add customer as a follower in portal_sale module (portal_sale.py using message_subscribe method). if you do not want to add customer as a follower you can comment this code or override that method in your module to avoid this functionality.

Avatar
Discard
Best Answer

It's a long time since you guys started this topic.

Is any module removing followers available or the only way is dig in the code ?

Avatar
Discard
Best Answer

Check out these functions:

get_partners_to_notify - in /addons/mail/mail_followers.py

message_get_suggested_recipients - in /addons/mail/mail_thread.py

message_get_suggested_recipients - in /addons/crm/crm_lead.py

message_get_suggested_recipients - in /addons/project_issue/project_issue.py

Avatar
Discard

Hello Ray. Can you explain to a beginner how must these files be changed? Thanks beforehand

Author

Finally we did develop a module together with a partner from us that allows us to set on every res.partner if it should get added automatically - spend some money for that also this module is able to show much more information in the chatter log e.g.: to what persons an E-Mail was really sent and so on...

Best Answer

Michael, thanks for your module. We're going to test it and we'll give feedback soon.

Avatar
Discard