*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
* 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
* 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
/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.
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
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.
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
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
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.
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.
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.
* Assign controller now effectively redirects to mail/assign instead of
mail/assign
* Follow and Unfollow button now uses the helper that generated the link
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
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
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
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.
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.
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.
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...
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
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.