f0261650ba072e730e34f78362287ccdbc45fe8e
Allow partner to unfollow a document from a follow up email or the inbox: - through an unsubscribe URL in the email even if not connected - through a link in the inbox **Details concerning the inbox implementation:** When hovering on a follow up message with a related document followed by the user, the interface displays an action to unfollow it that allows the user to remove himself/herself as follower of the document. As a result of performing that action a toast is displayed as a feedback. Technical note: The unfollow link is displayed on a message.canUnfollow is true which check that the thread related to the message is followed by the user. In order to know if the user follows the record related to the message, we now transmit with each message the id of the follower table that link the user to the related record if it follows it. This allows to insert the follower on client side so that the unfollow action can use the standard mechaism already developed to unfollow a record. Unfortunately, that information coudn't be added in the already public method message_format of mail message because that method is not always called on the user retreiving the message but also by the one posting message. We didn't want also to include all followers in the formated message so we rely on additional method that add that information per partner. To support unfollowing a document in the inbox no matter the current company, we have modified message_unsubscribe in mail_thread to allow internal user to unsubscribe themself without checking any rights. Indeed, some document have record rule that prevents reading it if the user is not in the right company (ex. crm.lead) and then was preventing the user to unfollow the document using that method. **Details concerning the mail implementation:** It works for internal user for follow up on any document and for any partner on follow up of document tagged as authorizing being unfollowed by any partner ( slide.channel and slide.slide). Technical note: The unfollow block is rendered in mail_thread and updated for each recipient in mail_mail. We don't render it in mail_mail because we don't have the language of the message at that point. Depending on the partner and the related document, the unfollow block is: - either removed if the user cannot unfollow the document (for example if it doesn't follow it) - or updated with partner and document information + a security token **Query count adjustment:** In order to display the unfollow link or not in emails or in the inbox, the system need to query the followers of the document. This is what explains the added queries. Task-3061864 closes odoo/odoo#107978 Related: odoo/enterprise#34972 Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
…
…
Odoo
Odoo is a suite of web based open source business apps.
The main Odoo Apps include an Open Source CRM, Website Builder, eCommerce, Warehouse Management, Project Management, Billing & Accounting, Point of Sale, Human Resources, Marketing, Manufacturing, ...
Odoo Apps can be used as stand-alone applications, but they also integrate seamlessly so you get a full-featured Open Source ERP when you install several Apps.
Getting started with Odoo
For a standard installation please follow the Setup instructions from the documentation.
To learn the software, we recommend the Odoo eLearning, or Scale-up, the business game. Developers can start with the developer tutorials
Languages
Python
49.6%
JavaScript
47.8%
SCSS
2%
CSS
0.3%
HTML
0.2%