Otherwise recomputation may fail with "record does not exist or has been
deleted" when creating records with a value directly set for e.g.
'image_mediun' on a new product.
The issue comes from the storage of the images. When creating a product, the
creation of an attachment for storing the field `image_medium` triggers the
recomputation of that field before its dependency `image` is set. As `image`
is initially null, `image_medium` is recomputed as null, and this deletes the
attachment just created before the latter has completed its creation! As a
consequence, some code at the end of `create` for the attachment crashes
because the record has been deleted.
The following models have been fixed: `fleet.vehicle.model.brand`,
`hr.employee`, `im_livechat.channel`, `mail.channel`, `payment.acquirer`,
`pos.category`, `product.template`, `product.public.category`, `res.partner`.
opw 666330
Closes#11516
Add a dummy 'match_rules()' function for backward-compatibility of commit
d8605b79, as 'match_rules()' was called from server-side 'im_livechat.loader'
template.
Since rev. 100d604, the web.session module is always loaded in external pages,
even if no operator is available. Thus, server_url should always be computed.
This reverts commit a8239cd as the navbar dropdown recently introduced now
offers a quick access to channels without coming back in the Discuss App.
Moreover, this commit emphasizes the notifications navbar icon when there are
unread messages (or at least, it mutes it when there isn't).
should be the length of the recordset of connected users, not the recordset
itself, which is always evaluated as True (thus, the im_livechat script was
always embedded in the html pages).
The problem was that the matching rule was evaluated before sending the html
page, and the script was inserted in the page according to the matching rule
(it wasn't inserted if the rule was 'hide_button'). However, the matching rule
wasn't re-evaluated if the page was already in the cache. The page content thus
might depend on a matching rule computed for someone else in that case.
Rather than inserting the script according to the matching rule, we insert it
only if there is an operator available. We then ask for the matching rule in
the livechat widget, by RPC, and we reject its willStart deferred if the rule
says so. We also re-check for operator availability in the same RPC.
The problem was that, when calling 'match_rules()' from the loader template,
we compared the wrong url with the url regexp defined in rules. Indeed, we used
the url of the page we were leaving, not the one we were going to.
We thus need to know if we are coming from the controller, or from the loader
template directly as the way to get the correct url differs.
Courtesy of JEM
- Don't display livechat button if no operator available
- Livechat windows persistence through website pages
- Auto popup feature re-introduced (inadvertently removed at rev. f23f57cc)
- Operators that are 'away' are available, as 'away' means that the focus isn't
on the Odoo tab for at least 10 minutes, but the user is still connected.
- Avoid duplicated messages when the visitor is a connected user
- Unfold livechat window on first 'close' click as the event is intercepted to
ask the user feedback before actually closing the window
The 'cron_remove_empty_session' is performed every day and removes livechat
channels that contain no message.
The problem was that the cron might have been executed between the moment a
public user clicked on the livechat button, creating a new empty channel, and
the moment this user sent the first message through that channel. If that
happenned, the message was sent in an unexisting channel, and obviously never
received by the operator.
This fix makes sure that removed empty channels haven't been created or
modified within the last hour.
This commit concerns DM and livechat channels. Those channels are now
automatically detached on the receiver side. This allows users to directly
reply to DM's or livechats without coming back to the client action.
Note that they aren't detached if the user previously manually closed the
channel's chat window.
Commit 2bb55ec adds argument extra_info to the signature of channel_info() in
mail addon. However, this method is inherited from the im_livechat addon, and
its signature hadn't been adapted, causing tracebacks when im_livechat was
installed and channel_info() was called with an extra_info.
Migrate the models and controller to new API. Renaming xml id according to convention, renaming openerp tag into odoo tag. Add comment strings and documentations.