[MOV] im_livechat : restructure the module according to the new mail module

This commit is contained in:
Jérome Maes
2015-09-01 20:16:09 +02:00
committed by Aaron Bohy
parent d3279983c8
commit 1d54858cbd
8 changed files with 4 additions and 16 deletions
+2 -2
View File
@@ -21,7 +21,7 @@ Help your customers with this chat, and analyse their feedback.
'data': [
"security/im_livechat_channel_security.xml",
"security/ir.model.access.csv",
"views/im_chat_session_views.xml",
"views/mail_channel_views.xml",
"views/im_livechat_channel_views.xml",
"views/im_livechat_channel_templates.xml",
"report/im_livechat_report_views.xml",
@@ -30,7 +30,7 @@ Help your customers with this chat, and analyse their feedback.
'demo': [
"data/im_livechat_channel_demo.xml",
],
'depends' : ["mail", "rating"],
'depends': ["mail", "rating"],
'installable': True,
'auto_install': False,
'application': True,
+1 -1
View File
@@ -1,4 +1,4 @@
# -*- coding: utf-8 -*
import im_livechat_channel
import im_chat_session
import mail_channel
import rating
@@ -38,7 +38,6 @@ class ImLivechatChannel(models.Model):
help="URL to a static page where you client can discuss with the operator of the channel.")
are_you_inside = fields.Boolean(string='Are you inside the matrix?',
compute='_are_you_inside', store=False, readonly=True)
script_internal = fields.Text('Script (internal)', compute='_compute_script_internal', store=False, readonly=True)
script_external = fields.Text('Script (external)', compute='_compute_script_external', store=False, readonly=True)
nbr_session = fields.Integer('Number of session', compute='_compute_nbr_session', store=False, readonly=True)
rating_percentage_satisfaction = fields.Integer('% Happy', compute='_compute_percentage_satisfaction', store=False, default=-1)
@@ -75,17 +74,6 @@ class ImLivechatChannel(models.Model):
self.image_small = False
self.image_medium = False
@api.multi
def _compute_script_internal(self):
view = self.env['ir.model.data'].get_object('im_livechat', 'internal_loader')
values = {
"url": self.env['ir.config_parameter'].sudo().get_param('web.base.url'),
"dbname": self._cr.dbname,
}
for record in self:
values["channel"] = record.id
record.script_internal = view.render(values)
@api.multi
def _compute_script_external(self):
view = self.env['ir.model.data'].get_object('im_livechat', 'external_loader')
@@ -7,7 +7,7 @@ var user_session = require('web.session');
var time = require('web.time');
var utils = require('web.utils');
var Widget = require('web.Widget');
var im_chat_common = require('im_chat.im_chat_common');
var im_chat_common = require('mail.chat_common');
var _t = core._t;
var QWeb = core.qweb;