Commit Graph
74 Commits
Author SHA1 Message Date
Rohan Patel 8c1f6a7cc6 [IMP] mail,*: replace emojis by unicode in chat messages
*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-11 12:20:49 +02:00
Christophe Simonis d5382abeaa [MERGE] forward port branch saas-17 up to b8dd34fcbb 2017-09-06 17:40:59 +02:00
Christophe Simonis b8dd34fcbb [MERGE] forward port branch saas-16 up to 64d56995e0 2017-09-06 13:29:05 +02:00
Christophe Simonis 64d56995e0 [MERGE] forward port branch saas-15 up to ef5ac872b8 2017-09-06 12:26:36 +02:00
jpr-odoo 46699c5214 [IMP] mail: Add a preview popup for attachments
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 15:52:15 +02:00
Christophe Simonis a9991e8082 [MERGE] forward port branch 10.0 up to abb726d4df 2017-09-04 18:47:40 +02:00
Christophe Simonis abb726d4df [MERGE] forward port branch saas-11 up to 431b30b478 2017-09-04 18:46:46 +02:00
Christophe Simonis 431b30b478 [MERGE] forward port branch saas-10 up to aab6bdd54a 2017-09-04 18:38:25 +02:00
Christophe Simonis 30bd5ac0e9 [MERGE] forward port branch saas-16 up to aec6248bb3 2017-08-23 16:44:58 +02:00
Christophe Simonis 59f8b849fb [MERGE] forward port branch saas-15 up to d5f2a38b50 2017-08-23 11:23:08 +02:00
Christophe Simonis 6956ad54de [MERGE] forward port branch 10.0 up to 6dc0f31415 2017-08-22 16:45:43 +02:00
Christophe Simonis 6dc0f31415 [MERGE] forward port branch saas-11 up to 92ec666f8d 2017-08-22 16:28:10 +02:00
Xavier Morel 7dd062f835 [FIX] P3: text model types
* 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 23:25:54 +02:00
Xavier Morel 3824b5dcc1 [FIX] P3: fix base64 and StringIO uses
* 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-20 23:25:54 +02:00
Xavier Morel a4ada695e1 [FIX] P3: absolute ordering removed 2017-08-19 02:34:21 +02:00
Thibault Delavallée aab6bdd54a [FIX] mail, website_(blog/forum/slides): correctly redirect users on 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-16 11:13:11 +02:00
Goffin Simon c49265afa1 [FIX] mail: Access rights error when reading leaves
Fine tuning of this commit: b795d69ce8

Steps to reproduce the bug:
Leaves > List view > Go into any validated leave > Get Odoo Server Error on access rights

opw:693536
2017-08-10 17:04:12 +02:00
Denis Vermylen 7dd6225f0b [IMP] mail, account, sale: improve sales order mail link
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-07-06 12:53:39 +02:00
Thibault Delavallée 3c2c166fa6 [FIX] mail: do not sudo access action fetch in /mail/view
Otherwise it is impossible to know the user trying to access the record.
This leads to some incoherent redirection.
2017-04-25 14:10:54 +02:00
Christophe Simonis 6c4389df41 [MERGE] forward port branch 10.0 up to 6804085b8c 2017-01-23 14:33:53 +01:00
Jeremy Kersten 9ac974548e [FIX] mail: don't check read access if user not connected.
In the worst case, user is not logged in and he will really have no access and
will have a perm read error after login. We cannot check if an unknow user has
access or not.

In most cases, user will be logged in and will see the document directly if
he has access or will be redirected to messaging if no access.

In the best case, he will be redirected to login page before to see the message.

task-22505
2017-01-11 11:12:47 +01:00
Christophe Simonis b3a1109372 [MERGE] forward port branch 10.0 up to c08a590bb1 2017-01-02 15:31:58 +01:00
Christophe Simonis 81f59cee2c [MERGE] forward port branch saas-11 up to b844d93889 2017-01-02 14:38:59 +01:00
Goffin Simon b795d69ce8 [FIX] mail: Modifying followers in multi company
In multi company, some followers of a document could be not
readable for a user who has the rights to modify this document.

If the user has the rights to write on a document, he is allowed
to read and modify the followers of this document.

opw:693536
2016-12-21 13:36:29 +01:00
Thibault Delavallée df01742fc0 [REF] mail, note, project, project_issue: remove 'new' button in notification emails
As this button leads to a void form view without context it is not
really usefull. As creating new records is achieved using aliases
there is no real need for a New Task/Issue/Note button.

mail/new controller is kept for compatibility but should be removed
before v11.
2016-11-04 10:50:29 +01:00
Christophe Simonis 341bea8f88 [MERGE] forward port branch saas-12 up to 43cb4ac 2016-10-10 13:00:05 +02:00
Olivier Dony eb6b256f99 [MERGE] Forward-port 9.0 up to b64b9619f8 2016-10-04 00:16:09 +02:00
Thibault Delavallée 0b87f76628 [IMP] mail: separate management of mail routes from redirection
Move code related to redirection in its own class method. This way all
controllers perform their own actions and checks before calling the
redirection itself. Moreover it is necessary for some controllers to be
able to call the redirection independently outside of the mail/view
controller scope.

This commit also fixes some links generated for mail notification email
buttons. Assign and (un)follow buttons now effectively use the link helper
when generating the associated URL instead of manually crafting it.

Custom routes for notification buttons used in HR and CRM are added.
Indeed in order to be able to fine-tune the behavior called by those
buttons, using dedicated controllers is simpler than trying to use
a generic one. As there are few custom buttons in notification emails
using dedicated controllers does not lead to a code overhead.
2016-10-03 19:03:50 +02:00
Thibault Delavallée a9bd9ab160 [FIX][IMP] various: unsudo mail/view controller and get_access_action
mail/view controller is a generic controller that redirects the user to a
given view, depending on the record and the user. Users may be redirected
to the backend form view, or to a website view. This is done notably by
calling get_access_action method that gives the action to perform (act_window
or url).

Previously this method was called using SUPERUSER. However it was therefore
impossible to know who the user was. This method is now called using the
current user. Various overrides of get_access_action have been updated to
add some logic and access rights check directly in the method allowing
more fine-grain behavior of the access action.
2016-09-23 10:01:04 +02:00
Thibault Delavallée 033fc508f4 [FIX] mail: fix notification buttons url generation
* Assign controller now effectively redirects to mail/assign instead of
   mail/assign
 * Follow and Unfollow button now uses the helper that generated the link
2016-09-23 10:00:18 +02:00
Christophe Simonis 235ed4b2c1 [MERGE] forward port branch saas-12 up to 9ad5f26 2016-08-20 18:08:19 +02:00
Thibault Delavallée e33435daa9 [MIG] mail: migrate remaining code in old API 2016-08-10 15:48:07 +02:00
Thibault Delavallée c8a313d51e [IMP] various: use odoo for imports instead of openerp and update class names 2016-08-10 15:48:07 +02:00
Jeremy Kersten 6ffc8b6261 [FIX] mail: controller avatar
FIX 1
-----
If the partner_id is not allowed, we return the placeholder.

Before this commit, the status as undefined and raise traceback.
UnboundLocalError: local variable 'status' referenced before assignment

FIX 2
-----
Fix the defaultheader to avoid to have:
   [[('Content-Type', 'image/png')], ('Content-Length', 43)]
And so, during parsing by werkzeug:
   ValueError: need more than 1 value to unpack
2016-08-03 13:02:31 +02:00
Christophe Simonis e7190cbbbf [MERGE] forward port of branch saas-10 up to 74b51d3 2016-07-05 23:42:12 +02:00
Jeremy Kersten c6e7e2d2aa [FIX] mail: controller avatar return placeholder if no content
binary_content return '' if no picture, so, we keep the placeholder
if no image has been returned.

It avoid in the new portal with discuss widget to get the default
browser 404 picture (file broken)

This commit close #12683
2016-07-05 12:34:06 +02:00
Christophe Simonis dda0d3d62d [MERGE] forward port of branch saas-10 up to baf494c
# Conflicts:
#	addons/hr_timesheet/project_timesheet.py
#	addons/sale_layout/i18n/es_PE.po
#	addons/sale_layout/i18n/hu.po
#	addons/sale_layout/i18n/lo.po
#	addons/sale_layout/i18n/pl.po
#	addons/sale_service/i18n/es_MX.po
#	addons/sale_service/i18n/es_PE.po
#	addons/sale_service/i18n/lo.po
#	addons/stock/stock.py
#	addons/stock/stock_view.xml
#	addons/warning/i18n/es_PE.po
#	addons/warning/i18n/lo.po
#	addons/warning/i18n/ru.po
#	addons/web/i18n/cs.po
#	addons/web/i18n/ja.po
#	addons/web/i18n/lo.po
#	addons/web/i18n/th.po
2016-06-15 12:59:39 +02:00
Christophe Simonis baf494c67b [MERGE] forward port of branch saas-9 up to 1d81bb0
# Conflicts:
#	addons/account_extra_reports/i18n/ca.po
#	addons/account_extra_reports/i18n/fi.po
#	addons/account_extra_reports/i18n/pl.po
#	addons/account_extra_reports/i18n/te.po
#	addons/account_extra_reports/i18n/zh_CN.po
#	addons/account_full_reconcile/i18n/hu.po
#	addons/account_full_reconcile/i18n/pl.po
#	addons/crm/crm_lead_menu.xml
#	addons/crm_claim/i18n/es_PE.po
#	addons/crm_claim/i18n/hu.po
#	addons/crm_claim/i18n/ja.po
#	addons/crm_claim/i18n/pl.po
#	addons/delivery/views/delivery_view.xml
#	addons/product/product_view.xml
#	addons/project_timesheet/i18n/es_PE.po
#	addons/stock/stock_view.xml
2016-06-15 12:40:59 +02:00
Christophe Simonis f9072c789d [MERGE] forward port of branch 9.0 up to bfbe2d6
# Conflicts:
#	addons/marketing/i18n/es_PE.po
#	addons/marketing/i18n/hu.po
2016-06-14 19:27:16 +02:00
Denis Ledoux 3ddb446b3b [FIX] crm, mail: Convert to opportunity in mail notification
The button "Convert to opportunity" in the mail notifications
sent when posting a message on an opportunity just coudln't
work as it attempted to call the `convert_opportunity`
method without one of its required method parameter.

opw-680017
2016-06-08 17:15:15 +02:00
Aaron Bohy de6fa69774 [ADD] mail: commands support
Use the mention mechanism to autocomplete on commands (keyword /).

A first command /help has been implemented.
2016-05-03 10:34:41 +02:00
Aaron Bohy 2264378739 [ADD] im_livechat,mail: canned responses support
Use the mention mechanism of the composer to autocomplete on canned responses
(keyword :) with fuzzy search.

Directly perform the string replacement in the composer, instead of
server-side as before.

Add a menu item to access an editable list view to create and edit canned
responses.

Add two canned responses as demo data.
2016-05-03 10:34:41 +02:00
Jigar Patel 253d4eccf0 [IMP] mail: Add counter in starred 2016-04-08 13:41:01 +02:00
Aaron Bohy 533da62a6b [FIX] mail: read_followers() doesn't need res_id
When creating a new record, read_followers() was called without res_id and it
produced an error as the argument didn't have a default value. That argument
wasn't used anyway so this rev. simply removes it.
2016-03-16 11:21:34 +01:00
Aaron Bohy 1e0bc5920f [IMP] mail: follower: remove an RPC when user is follower
When loading a form_view with the follower widgets, an RPC was performed to get
the followers info (name, email...), and if the user is one of the followers,
a second RPC was done to retrieve the subtypes.

This rev. batches those two RPCs. Also simplifies read_subscription_data() as
it is now always called with a follower_id.

A few code refactoring as well.
2016-03-02 13:39:16 +01:00
Aaron Bohy a4dade389b [IMP] mail: batch RPCs at init
Remove the RPC to retrieve the action_id of the client action as do_action()
can take directly the xml_id, and batch the RPC to retrieve the menu_id with
the initial RPC used to fetch channel slots, emojis...
2016-02-12 12:04:02 +01:00
Christophe Simonis 469e04e97c [MERGE] forward port of branch saas-8 up to 2611a81 2016-02-02 14:52:15 +01:00
Nicolas Lempereur f5fedbcb18 [FIX] mail, portal_sale: conserve action in /mail/view
Methods get_formview_action can be called by sudo() so for knowing the
real user they should prefer context['uid'] to uid.

Without the action `/web` can't figure out that e.g the view we want is
the one for portal user and not the default one.

With this fix, portal user (not in base.group_user) get to the intended
view with the intended menu when clicking on a invoice/sale order portal
mail link. As for other user there is no change.

closes #10681
opw-666260
2016-01-29 12:08:24 +01:00
Christophe Simonis 5ba5172d99 [MERGE] forward port of branch saas-8 up to 8064379 2016-01-07 15:16:56 +01:00
Aaron Bohy a4ddfe0b28 [IMP] mail: merge chat initial RPCs
Two RPCs were performed by the chat_manager on webclient launch. One of them
was about emojis, and recent messages received in the past 10 minutes in
detached channels. This RPC has been removed as the emojis fetching can be
done in the other RPC (mail/client_action), and the recent messages are not
useful since the refactoring of mail and the introduction of the chat_manager.
2015-12-28 10:05:15 +01:00