summaryrefslogtreecommitdiff
path: root/addons/website_livechat/views
diff options
context:
space:
mode:
authorAurélien Warnon <awa@odoo.com>2019-01-03 08:19:21 +0000
committerjem-odoo <jem@openerp.com>2019-04-01 07:03:11 +0000
commitc04b9c019eb4c04d62d1d90b810c5407d8a9b5bd (patch)
tree8d6d9d1e1b36c750c5b552b81ca33fa39094e147 /addons/website_livechat/views
parent92e9e84b63a266b39d556c1db1d336373dc8b303 (diff)
[REF] im_livechat: rework some 'im_livechat.channel' model methods
Purpose ======= Several methods of the 'im_livechat.channel' model were passed a 'channel_id' to work on. This has been changed so that the caller can use those methods on an instance of this model instead. Some methods have also been switched to private because they had no apparent reasons to be public. This is a preliminary cleaning for task #1919871 Specicial note for the "loader" template: To load the livechat assets in a website page, the 'loader' template of livechat is directly called (instead of being returned through a controller) in order to avoid a new call to server. As this commit moves 'sudo' to make method callable on the record directly, it still needs to be sudo. First solution was to add the 'sudo' in the template, which is a bad practise. This commit creates a proxy method on website model returning the livechat info with 'sudo'. This avoid having the 'sudo' done in template. Like always, explicit is better than implicit. Task-1919871
Diffstat (limited to 'addons/website_livechat/views')
-rw-r--r--addons/website_livechat/views/website_livechat.xml2
1 files changed, 1 insertions, 1 deletions
diff --git a/addons/website_livechat/views/website_livechat.xml b/addons/website_livechat/views/website_livechat.xml
index e5f429fc806..82580fc6549 100644
--- a/addons/website_livechat/views/website_livechat.xml
+++ b/addons/website_livechat/views/website_livechat.xml
@@ -49,7 +49,7 @@
<t t-if="website and website.channel_id">
<script>
<t t-call="im_livechat.loader">
- <t t-set="channel" t-value="website.channel_id.id"/>
+ <t t-set="info" t-value="website.get_livechat_channel_info()"/>
</t>
</script>
</t>