summaryrefslogtreecommitdiff
path: root/addons/mail/controllers
AgeCommit message (Collapse)Author
2019-03-27[IMP] mail: add a different layout for inactive followersJulien Giannone
When displaying the followers of a document, followers who are set as inactive will be displayed in a different layout than the active ones. The purpose is to mark a clear difference between active and inactive followers. Task #1957849 closes odoo/odoo#32084 Signed-off-by: Xavier Dollé (xdo) <xdo@odoo.com>
2019-02-13[REF] im_livechat, *: remove JSONP in favor of CORSMartin Geubelle
When embedding the livechat on an external website, we used to make JSONP calls. As the support of JSONP calls has been dropped, we now use the CORS mechanism instead.
2018-12-06[REF] base, *: refactor binary_contentThanhDodeurOdoo
*: tools, web, website, website_forum, mail, im_livechat This commit refactors ir_http to make it more readable and flexible. Move the resize function of web/image to odoo.tools Co-authored-by: XavierDo <xdo@odoo.com> Co-authored-by: Antony Lesuisse <al@openerp.com> closes: #28563 task: #1908896
2018-11-29[REF] *: replace deprecated pycompat helpers for builtinsAdrian Torres
This commit replaces calls to pycompat helpers that were intended for python 2 <-> python 3 interoperability for python 3 builtins, as python 2 is no longer officially supported by Odoo. This includes: * calls to imap/izip/ifilter replaced by map/zip/filter * uses of text_type replaced by str * uses of unichr replaced by chr * calls to implements_to_string, implements_iterator removed * string_types and integer_types replaced by str, int respectively * calls to to_native replaced by calls to to_text This is done in preparation to the removal of these deprecated helpers in the following commit.
2018-08-17[REF] mail,im_livechat,digest: rename 'chat_client_action' to 'Discuss'Alexandre Kühn
Revision on https://github.com/odoo/odoo/commit/02ec09cb1c3e2d7bc7968f40c18f2208d7f3f498#diff-6d76770b1b7cf716d60a4d76a1555c1d The commit above mostly renamed 'Client Action' to 'Discuss', but there were some leftovers.
2018-08-14[MERGE] forward port branch saas-11.4 up to dabe59df9c8Christophe Simonis
2018-08-14[MERGE] forward port branch saas-11.3 up to 27d8daf8a75Christophe Simonis
2018-08-13[FIX] mail: Keep backward compatibility on route /mail/viewToufik Benjaa
- If a database is migrated from an older version to saas-11.3 without this patch, all the links /mail/view with a message_id as parameter will not work. We must keep the backward compatibility for those links.
2018-08-03[IMP] Portal - Share link : Easily share the url of a documentMitali Patel
Purpose ======= - Quickly share the url to someone else (a client, a colleague,...) - Ensure that the recipient can access at least the portal view of the shared record. - Typically used when a client cannot retrieve the mail to access his order. The share link can be used in this case. Specifications ============== For any object inheriting form portal.mixin: - Add a button SHARE (not visible in edit mode) - When clicking on this button, a popup opens with : - A warning message for tasks and projects only (see below) - the link (like in gmail) that can be copied - Recipients - mail composer (with preselected template) ==> see below - button [Send Link] [Copy Link] Discard - After sharing document, put internal note like "Document shared to xyz,...." with template message - Anyone with the link, even anonymous user (not logged in) can have access to the document with the access token provided in the url. Impacted models: - account.invoice (Community) - project.project (Community) - project.task (Community) - purchase.order (Community) - sale.order (Community) - helpdesk.ticket (Enterprise) Warning messages and access rules: Allowed : - SO canceled or draft will be accessible with the link with access_token - If the customer account is B2B (signup not enabled), the recipient will anyway see the document as the user specifically wants the recipient to see the document. Restrictions : - For Project and Task, if the privacy is not public, then, there is a contradiction between the access_token mechanism and the privacy of the document. - A warning message will be displayed in the share wizard to inform the user if the document cannot be visible by the recipients and to ask him to set the privacy to 'Visible by following customer'. The send button will, in that case, be hidden. - To avoid to block the share for a new project, default privacy value is now set to 'Visible by followong customer' Technical implementation ======================== - Move the access_token mechanism (field + methods + mail controller) to the portal.mixin to be able to use it in a generic way for each object inheriting the portal.mixin - Generalise a part of the _*model*_get_page_view_values method into a single one in portal - Generalize the _*model*_check_access into the portal controller of the portal module - Remove the init_column + default value for the access_token > old records have an access_token, > new one won't but it will be generated on demand via the get_access_token Done for performance reasons - Add share button into action menu separately. + kanban view context menu (except for task and project where button not in action menu but 'simple' button for task and project because other modules already provide action to send documents by email, which is not the case for project and task.) - Add a sign_token used to authentify the recipient in the portal view chatter, if any. The message will be posted as if the user was logged in. - Set the _get_share_url as private for security reason - Add a redirect parameter to _get_share_url to get If false : The direct portal view url If True : The redirect url (mail/view/?) - Cleaning up unnecessary code - Bug fix : - Before, if user was not logged and record had partner_id, if partner id was null, post message was done as admin. Now, the post message is done as public user. - If the user had an uid but had no access_token, he could be able to gain the access token of the record. check_access_rights was missing in the get_access_action. Task ID : 30985 Closes #25629
2018-06-07[ADD] mail, mass_mailing: allow a user to resend a mail with failuresXavierDo
When a mail is in failure state, a red envelope appears next to the message in a thread but it was difficult to send the mail again. This tasks will allow users to send mail again easily, or mark notification as cancelled if the user want to ignore this failure. A notification will appear in sender systray while mail are in failure. Task: #46158 PR: #24628
2018-06-06[IMP] mail: add moderation on channelsMathieu Duckaerts-Antoine
Purpose of this commit is to allow moderation on incoming messages in discussion channels. On some channels on which moderation is required messages should be in a pending moderation stage. Moderators can accept or refuse messages as well as always allow or ban messages coming from a given set of emails. Channels now have an option to be moderated. Moderators can be added on channels. They have access to a specific UI in Discuss to see and take action on messages waiting for moderation. Concerning mail.thread message that are pending moderation are not notified. It means nobody receives a notification about them. Moderation process calls the notification once the message is validated. Various features included in this commit : * a model is added to store the decision about emails, allow or ban; * access rights are updated so that only moderators can modify moderation fields on message; * specific bus notifications are send to moderated people as well as to moderators on incoming emails as well as when a decision is taken; * options are added on channels to send explanations to moderated emails; * options are added on channels to write and send guidelines explaining why and how moderation is performed; * a reminder is send daily to moderators with remaining messages to moderate; * discuss UI is adapted and a new channel is added below Inbox and Starred giving access to moderation tools; * chanenl UI is adapted allowing to moderate directly inside channels; This commit is linked to task ID 29521. Closes #21921.
2018-05-15[IMP] various: clean references to removed content_subtype post parameterThibault Delavallée
content_subtype was a parameter to message_post allowing to give plaintext content instead of html content. It has been removed at 74d4b3902d51bf805f87bfd853f54407137b0ac3. This commit cleans some leftover bits referencing this now removed parameter.
2018-04-09[IMP] im_livechat, mail: replace emoji with unicode.XavierDo
Remove the support to replace emojis by images. Most browser now support colored emoji or at least black and white emojis. The emojis list have been updated to ensure a correct support for most os/browser. Users have the possibility to install fonts localy if their os does not have one of the default emoji font installed. After default os emoji font, one of twemoji, emojione or noto color will be selected. The emoji list is now hardcoded in js in order to reduce the number of records in shortcodes. Also include a small fix for livechat to display message field when rating is bad. Task #36898 PR #23689
2018-04-09[REF] mail, note: move reminder feature from mail to noteDharmang Soni
This commit refactors f488dc58c37fdc7fd49df759165de641e213444b that added reminder feature in activities. After merging it was suggested specifications were not correct and it has been decided to move the whole reminder feature in note. Reminders are now notes instead of activities. Now when having note appµ systray proposes to create a note / reminder. A note.note record is created with info given by the user. If a date is given in the systray quick create then an activity is scheduled on this note. This means user can create records in activity systray that are not activities but notes used as reminders. Those will use the first availableµ note column for the user. As reminders are now notes the support of activities not linked to any document is removed, as well as archiving activities and tests linked to that behavior. This commit has been not carefully tested nor in-depth reviewied. It is considered as too important for the upcoming freeze. This closes task ID 1833628. Closes #24129 . Many thanks to @dpr-odoo for its quick development and good work on this task.
2018-03-27[IMP] mail: take first found reminder activity type as default when creating ↵Thibault Delavallée
reminders If people define several reminders, take first found one based on sequence as default activity type when creating reminders. This commit is linked to the recent merge of reminders done at f488dc58c37fdc7fd49df759165de641e213444b.
2018-03-27[IMP] mail: allow to use stand alone activities as remindersDharmang Soni
This commit allows to create personal reminders and to manage them using activities. It is done using activities not necessarily linked to a record but only to a user. Reminders can be used for example as a personal todo list. Technically we choose to model a reminder as an activity related to no record. This means having a void res_id and model. An activity type is added to classify reminders in it. Settings reminder as done is not done like classic activities. Indeed classic activities are unlinked and a message is logged on the related document. As there is no document for reminders those are archived instead. It means an active field is added as well as an override of toggle_archive to update systray counter. Activities systray widget is improved to display reminders in activities list. This entry leads to a kanban view of activities allowing their management. It is also possible to create them directly from the systray allowing a quick creation of reminders. This commit is related to task ID 41745. Closes #22143 . Co-authored-by: Dharmang Soni <dpr@odoo.com> Co-authored-by: Xavier Dollé <xdo@odoo.com>
2018-03-14[REF] mail: support only model / res_id in mail/view redirection controllerThibault Delavallée
Currently mail/view controller supports either a message_id, either a model/res_id . Using a message_id is just a shortcut to find its model and res_id before redirecting to the record view. If the message has been removed the controller does not work anymore although with model and res_id it still works while the record exists. Same functional behavior can be achieved with only model and res_id. Let us drop support of message_id to lessen code size.
2018-03-14[REM] mail: remove deprecated controllers follow, unfollow and newThibault Delavallée
Mail holds some controllers used notably in notification emails to allow some action directly from email buttons. It is used for example to redirect people to the right view when clicking on 'view document' button. Some deprecated controllers still exist in codebase but are not used anymore. The 'new' controller notably has been removed at df01742fc09989ec830c27427298a99491c9746a . The '(un)follow' controllers have been removed recently at 11d2d30e91758baaa9c6241a86f97ae3dfe52ad2 . Let us remove that dead code.
2018-02-26[REF] mail: rename notification methods related to recipientsThibault Delavallée
This commit renames some internal mail.thread methods linked to the notification process. This is the next commit of a series aiming at improving code readability and method finding through prefixes. See notably cae1c3977ff2777dcb77e4c2a51deb72ee57db22, cdfe479e2e92b8bfc4e4d5bb32c1db8ad5c431d6 and fc1348dd3d73c2a5fbcc043f75b00272fedd6b20. This commit does not change any functional feature. It does only rename notification-related methods, using the _notify prefix to ensure they are private and to mark they are part of the notification process.
2018-02-26[REF] mail: consider body in message_post is always htmlThibault Delavallée
Purpose of this commit is to simplify a bit message_post API. It has a content_subtype parameter allowing to receive plaintext content. It is then automatically converted into html. This commit removes the parameter and consider the content is always html. Code calling message_post should handle the conversion. In Odoo the only use was in the chat_post controller that now perform the plaintext to html conversion before calling message_post. This commit is purely technical and does not hold any functional change. Purpose is to clean code in order to prepare future changes in mail application.
2018-02-21[FIX] mail: set view_id in mail/view only if we have one to specifyThibault Delavallée
Currently if get_formview_id does not return a specific view id the mail/view controller produces an url with view_id=False. Due to some unknown reason it is not taken into account as False but as the string False since some time. It generates a traceback and prevent people from using the mail/view controller. While finding why it seems to have changed we can avoid the issue by setting the view_id only if set. It has no impact on the redirection has the default for view is loaded as intended.
2018-02-01[REF][IMP] *: mail js refactoringAaron Bohy
This commit improves the JS code of the mail module, which comes maily from the new coding guidelines and the addition of "JS services". JS services are important objects that do not fit well in the component tree, such as chat_manager or ajax. The benefits of JS services are improved readability of the code, reduced coupling, and more testable modules. In particular, discuss was hard to Summary of the changes: - ClientAction has been renamed into Discuss - Clear instantiation of chatManager - New coding guidelines in most mail modules - JS Services can interact with each other - Chat Manager and Window Manager are services - Window Manager renamed to Chat Window Manager - bus.bus is now encapsulated in Bus Service (a service) - The test infrastructure has been tweaked with JS Services - Chat Mixin has been removed A future improvement would be to translate some 'trigger' into 'trigger_up'.
2018-01-08[REM] mail: remove unnecessary methods from mail.threadThibault Delavallée
* one dead method; * one unnecessary method to inline; * one unnecessary wrapper;
2017-11-09[MERGE] forward port branch saas-16 up to 82add438f21Christophe Simonis
2017-11-09[MERGE] forward port branch saas-15 up to 90ca8720717Christophe Simonis
2017-11-09[MERGE] forward port branch 10.0 up to a63ecee47acChristophe Simonis
2017-11-09[FIX] mail: visitor to portal_user should keep livechat channelLucas Perais (lpe)
adapting #20279 to v10 Before this commit, when starting a livechat session as a public user and continuing as a portal user, the livechat crashed (the poral user couldn't see the channel created before as Admin) After this commit, the conversation is kept and security insured by the uuid in the cookie OPW 775568 closes #20281
2017-10-18[MERGE] forward port branch 10.0 up to 388bf45853dChristophe Simonis
2017-10-18[FIX] mail: indentation issue when forward-portingThibault Delavallée
Commit aab6bdd54a11cb8bdb19746a9861776d3be622a6 was incorrectly forward-ported to 10.0 at abb726d4dfaae87438471283aedd177d5432f10a . Indeed share users could land to a wrong backend or frontend page depending on the target app due to an indentation issue.
2017-09-11[IMP] mail,*: replace emojis by unicode in chat messagesRohan Patel
*im_livechat,rating. Emojis are now encoded in unicode characters in messages. This allows to copy/paste messages including emojis, ensures that emojis are properly displayed in mail interfaces (at least those that support unicode, e.g. GMAIL, counter-example: outlook), and allows the user to directly use emojis of its smartphone in mobile. This commit also adds several new emojis. PR #11095
2017-09-06[MERGE] forward port branch saas-17 up to b8dd34fcbb8Christophe Simonis
2017-09-06[MERGE] forward port branch saas-16 up to 64d56995e04Christophe Simonis
2017-09-06[MERGE] forward port branch saas-15 up to ef5ac872b81Christophe Simonis
2017-09-05[IMP] mail: Add a preview popup for attachmentsjpr-odoo
Purpose ======= The goal is that when you click on an attachment, you should get a preview of it and then you get the possibility to download it.
2017-09-05[FIX] mail: Don't compute channel history if no channelYannick Tivisse
Purpose ======= As the method `channel_fetch_message` calls self.ensure_one(), we shouldn't load the channel history if no channel is already existing for the external user. Specification ============= Return a empty list if channel_id is False
2017-09-04[MERGE] forward port branch 10.0 up to abb726d4dfaChristophe Simonis
2017-09-04[MERGE] forward port branch saas-11 up to 431b30b4787Christophe Simonis
2017-09-04[MERGE] forward port branch saas-10 up to aab6bdd54a1Christophe Simonis
2017-08-23[MERGE] forward port branch saas-16 up to aec6248bb37Christophe Simonis
2017-08-23[MERGE] forward port branch saas-15 up to d5f2a38b50cChristophe Simonis
2017-08-22[MERGE] forward port branch 10.0 up to 6dc0f314153Christophe Simonis
2017-08-22[MERGE] forward port branch saas-11 up to 92ec666f8d7Christophe Simonis
2017-08-20[FIX] P3: text model typesXavier Morel
* remove references to basestring & unicode (use relevant pycompat helpers) * remove some str calls (either entirely or replaced by relevant helper, either text or native) * use better API to avoid unnecessary conversions * remove some XML declarations in views
2017-08-20[FIX] P3: fix base64 and StringIO usesXavier Morel
* StringIO removed from stdlib, replace with io * try to correctly handle BytesIO/StringIO (one is for bytes the other is for text) * fix base64: Python 3 removed bytes-encoding and bytes-bytes codecs (via #encode) so replace all calls to str.encode('base64'), also b64encode is a bytes->bytes conversion so attempt to properly handle that issue #8530
2017-08-19[FIX] P3: absolute ordering removedXavier Morel
2017-08-16[FIX] mail, website_(blog/forum/slides): correctly redirect users on ↵Thibault Delavallée
backend/frontend /mail/view controller is a generic controller that redirects to a view on a document either on backend or frontend depending on the module, user and some model specific conditions. However currently url computation is not always correct as you may end up on frontend view even when you are a regular user that should land on backend views. In this stable version we introduced a key in the returned action that indicates the action is a pure front-end (public) action or not. This way people are correctly redirected to the backend or the frontend when going through the controller.
2017-08-10[FIX] mail: Access rights error when reading leavesGoffin Simon
Fine tuning of this commit: b795d69ce8aca2e88182c6d6d6b7af54d536f9dd Steps to reproduce the bug: Leaves > List view > Go into any validated leave > Get Odoo Server Error on access rights opw:693536
2017-07-06[IMP] mail, account, sale: improve sales order mail linkDenis Vermylen
Mail now can handles a generic access_token in /mail/view route. Mail does not do anything with it. Addons can override the controller and add their specific management of this token according to some specific business logic. Sale order emails now contains the access token to grant access from the notification email url without logging in. Sale portal now allow customers to log in using an access token without having to use Online Quote. If the user doesn't have an account yet and signup is allowed (B2C) an extra parameter is added to the url to link the correct partner to the user upon signup. If the user already has an account an extra parameter is added to auto-fill the user's login if he wants to login from that session. Account is also updated to prepare accepting access tokens. However the complete implementation of accounting customer portal will be done in another task coming soon.
2017-04-28[FIX] Various P3-related import changesxmo-odoo
* LDAP import: python-ldap is not python3-compatible, pyldap is Warning: only supported from debian Stretch (current testing)? https://packages.debian.org/search?searchon=names&keywords=pyldap * implicitly relative imports * imports of moved or removed stdlib modules issue #8530
2017-04-25[FIX] mail: do not sudo access action fetch in /mail/viewThibault Delavallée
Otherwise it is impossible to know the user trying to access the record. This leads to some incoherent redirection.