* mail_message.message_read() method is not used anymore since the chatter
refactoring in v9. message_format() is used instead. Tests for this method
are also removed, as they have no use anymore.
* mail_thread.message_set_read() is not used anymore. set_message_done is the
only method used by the new chatter as there is no read state anymore.
* removed an unused parameter in set_message_done, by the way
Currently no access button is displayed if the email is a discussion and has
no contextual actions like creating a new document, or setting the responsible
of the document. However it leads to emails being sent without access button.
This can be extremely frustrating and make the notification email quite
impossible to use efficiently.
With this commit when an user has access to a document the link to the document
is always displayed in the notification email.
get_formview_action and get_formview_id are methods used notably in a
redirection called from a mail controller used in notification emails.
Those methods however are defined as cr, uid, id and are interpreted
as api.one when called by a new-api style method.
With modules being converted into the new API, those methods are called
as api.one and the result is encapsulated into a list.
To avoid having to take the first element of the returned list we decided
to simplify the call chain and migrate the methods as multi methods, using
ids instead of id. Various addons have been updated accordingly. A temporary
support of ids being an int / long has been added to avoid conflict with calls
using id (for example if javascript is not updated).
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
It might happen that a transaction produces more than one message in the
chatter. In this case, the messages are created with the exact same
date, and they might appear in the wrong order in the chatter.
We therefore sort the messages by id, and not by date. Note that the
messages are already sorted when received from the server, but the web
client has its own management of the messages' order. Relying on the
server order might imply to change other parts of the code on client
side, which is something we want to avoid on a stable version.
opw-681049
Rev. 15174e9a70 explicitly
cached ir.ui.menu entries, and required an explicit
cache invalidation when users changed their mail.group
subscriptions (mail.group used to override the ir.ui.menu
search(), cfr e.g. 89e404301b)
The menu search() override is gone as of 9.0, so it's time we get
rid of the unnecessary cache invalidation.
When the mail composer is opened thanks to the "Send Mail" button in
Discuss, it's possible to save a mail template, but the user can't
access it anymore later on.
This is because the field `model` is by default empty in this specific
case since this is a client action. However, when saving the template,
the default value 'mail.template' is used for the `model` field.
Therefore the domain on the `template_id` field prevents the user to
find back the model he just saved.
The fix sends the `active_model` in the context with the value
'mail.message', so that the `default_get` method of
`mail.compose.message` will set the appropriate default value.
opw-677936