-
- Downloads
[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
Showing
- addons/im_livechat/controllers/main.py 3 additions, 4 deletionsaddons/im_livechat/controllers/main.py
- addons/im_livechat/models/im_livechat_channel.py 20 additions, 20 deletionsaddons/im_livechat/models/im_livechat_channel.py
- addons/im_livechat/views/im_livechat_channel_templates.xml 0 additions, 4 deletionsaddons/im_livechat/views/im_livechat_channel_templates.xml
- addons/website_livechat/models/website.py 11 additions, 1 deletionaddons/website_livechat/models/website.py
- addons/website_livechat/views/website_livechat.xml 1 addition, 1 deletionaddons/website_livechat/views/website_livechat.xml
Please register or sign in to comment