Refactoring of qweb to call _post_processing_att for each nodes. This
change remove the crappy ovewrite in website module. The website overwrite
only the _post_processing_att to add the cdn parameters.
The static node (without t- attributes) can stay static (remove overwrite
of _is_static_node), the cdn is applied at the compile time for this
nodes instead of at the running time like the dynamic node.
Have the public user (not logged in -- user B) having a live chat with any logged in user (user A)
Having in mind that:
- (A) issues /history in his chatter to see where (B) has gone on the website
- The bus sends a kind of a "pull cookie request" on each clients
- The browser of (B) retrieves the cookie info and calls the relevant route
- That route sends the transient message for (A)
Before this commit:
The command did not work because the user of the route we end up on is the public one
hence, the search for the channel would not yield anything
After this commit:
The command does work as expected
OPW 1818732
closes#23485
- Set the browser to language 'Spanish (Latin America)' ('es-419')
- As a public user, open a livechat session.
The session doesn't open.
The root cause is the creation of a mail channel which contains
translatable fields (e.g. name). This attempts to create translations
in the 'es_419' language. However, this locale doesn't exist in Odoo,
and it triggers the constraint 'lang_fkey_res_lang'.
In this specific case, there is no real reason to translate the channel
name. Therefore, we simply avoid it thanks to a context key.
opw-766489
this commit introduces the '/history' command
for an operator during a livechat session.
When the visitor load a page, its url is added in
a cookie (kept only 1 day) in order to track his
visited web pages.
The '/history' command will ask the cookie content
and send it to the operator as a transient message
in the livechat channel.
Loading history can contains sensitive informations.
You can load the history of a public conversation if
you have its uuid.
This commit stops using unsecure controller when a
secure one for this case exists !
This revision is related to 100d604cb0
The above revision aimed to add the correct `content-type` headers,
the according route returning Javascript and not simple html.
HttpRequest.render` returns a Response,
and `make_response` doesn't expect a Response as first argument.
In other words, this is not possible to make Reponse from a Response.
`HttpRequest.render` accepts kwargs, including `headers`.
opw-666898
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
I miss commit c3c2281a4d, so the search on attachment url is useless now.
Also check if the return content is not None, avoiding to decode base64 a None object.
On website page, in debug mode, error 'web.session already defined' appears in the console. This was due to the fact the namespace web.session was redefined a second time to bind the session on the server_url param for the livechat to work. On website page, this is already done by the native web.session (session_instance.js). Define a session in the bundle is required when livechat is intergrated on external page, so fetching the bundle is done through /im_livechat/loader/, and generating a web.session can be conditional.
The commit 6327cda0a7 introduce mock_attachment object, replacing ir.attachment. This new object doesn't not have id attribute : accessing it crashes. livechat controller needs to search on the mock url to generate the status, headers and content of the response via binary_content() method.
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.
The bus channel will still be public (using the uuid), but access to the message history and session information should be with the authenticated user and not the anonymous one. There is no anonymous name, and the request.session is used to identify the user.