[FIX] rating: correct list view (list --> tree)
[FIX] livechat_rating: ratings from livechat should be consumed (otherwise invisible) [IMP] usability: better views and tooltips
This commit is contained in:
@@ -87,6 +87,7 @@ class LivechatController(http.Controller):
|
||||
# limit the creation : only ONE rating per session
|
||||
values = {
|
||||
'rating': rate,
|
||||
'consumed': True
|
||||
}
|
||||
if not channel.rating_ids:
|
||||
values.update({
|
||||
|
||||
@@ -58,13 +58,6 @@
|
||||
<field name="help">Livechat Support Channel Statistics allows you to easily check and analyse your company livechat session performance. Extract information about the missed sessions, the audiance, the duration of a session, etc.</field>
|
||||
</record>
|
||||
|
||||
<menuitem
|
||||
id="menu_reporting_livechat"
|
||||
name="Report"
|
||||
parent="menu_livechat_root"
|
||||
sequence="50"
|
||||
groups="im_livechat_group_manager"/>
|
||||
|
||||
<menuitem
|
||||
id="menu_reporting_livechat_channel"
|
||||
name="Session Statistics"
|
||||
|
||||
@@ -12,7 +12,7 @@ class ImLivechatReportOperator(models.Model):
|
||||
|
||||
partner_id = fields.Many2one('res.partner', 'Operator', readonly=True)
|
||||
livechat_channel_id = fields.Many2one('im_livechat.channel', 'Channel', readonly=True)
|
||||
nbr_channel = fields.Integer('# of channel', readonly=True, group_operator="sum", help="Number of conversation")
|
||||
nbr_channel = fields.Integer('# of Sessions', readonly=True, group_operator="sum", help="Number of conversation")
|
||||
channel_id = fields.Many2one('mail.channel', 'Conversation', readonly=True)
|
||||
start_date = fields.Datetime('Start Date of session', readonly=True, help="Start date of the conversation")
|
||||
time_to_answer = fields.Float('Time to answer', digits=(16, 2), readonly=True, group_operator="avg", help="Average time to give the first answer to the visitor")
|
||||
|
||||
@@ -221,17 +221,31 @@
|
||||
sequence="5"/>
|
||||
|
||||
<menuitem
|
||||
id="session_history"
|
||||
name="History"
|
||||
id="menu_reporting_livechat"
|
||||
name="Report"
|
||||
parent="menu_livechat_root"
|
||||
sequence="50"
|
||||
groups="im_livechat_group_manager"/>
|
||||
|
||||
|
||||
<menuitem
|
||||
id="session_history"
|
||||
name="Sessions History"
|
||||
parent="menu_reporting_livechat"
|
||||
action="mail_channel_action"
|
||||
groups="im_livechat_group_user"
|
||||
sequence="10"/>
|
||||
sequence="1"/>
|
||||
|
||||
<menuitem
|
||||
id="livechat_config"
|
||||
name="Configuration"
|
||||
parent="menu_livechat_root"
|
||||
sequence="55"/>
|
||||
|
||||
<menuitem
|
||||
id="canned_responses"
|
||||
name="Canned Responses"
|
||||
parent="menu_livechat_root"
|
||||
parent="livechat_config"
|
||||
action="im_livechat_canned_response_action"
|
||||
groups="im_livechat_group_user"
|
||||
sequence="15"/>
|
||||
|
||||
@@ -27,6 +27,7 @@
|
||||
<tree string="History" create="false">
|
||||
<field name="create_date" string="Session Date"/>
|
||||
<field name="name" string="Attendees"/>
|
||||
<field name="rating_count" string="Has a Rating"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
@@ -108,7 +109,7 @@
|
||||
<record id="mail_channel_action_from_livechat_channel" model="ir.actions.act_window">
|
||||
<field name="name">Sessions</field>
|
||||
<field name="res_model">mail.channel</field>
|
||||
<field name="view_mode">list,form</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="domain">[('livechat_channel_id', 'in', [active_id])]</field>
|
||||
<field name="context">{
|
||||
'search_default_livechat_channel_id': [active_id],
|
||||
@@ -116,6 +117,20 @@
|
||||
}</field>
|
||||
<field name="search_view_id" ref="mail_channel_view_search"/>
|
||||
</record>
|
||||
<record id="mail_channel_action_livechat_tree" model="ir.actions.act_window.view">
|
||||
<field name="sequence">1</field>
|
||||
<field name="view_mode">tree</field>
|
||||
<field name="view_id" ref="im_livechat.mail_channel_view_tree"/>
|
||||
<field name="act_window_id" ref="im_livechat.mail_channel_action_from_livechat_channel"/>
|
||||
</record>
|
||||
|
||||
<record id="mail_channel_action_livechat_form" model="ir.actions.act_window.view">
|
||||
<field name="sequence">2</field>
|
||||
<field name="view_mode">form</field>
|
||||
<field name="view_id" ref="im_livechat.mail_channel_view_form"/>
|
||||
<field name="act_window_id" ref="im_livechat.mail_channel_action_from_livechat_channel"/>
|
||||
</record>
|
||||
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
|
||||
@@ -31,7 +31,7 @@ class Rating(models.Model):
|
||||
res_id = fields.Integer(string='Document ID', required=True, help="Identifier of the rated object", index=True)
|
||||
rated_partner_id = fields.Many2one('res.partner', string="Rated Partner", help="Owner of the rated resource")
|
||||
partner_id = fields.Many2one('res.partner', string='Customer', help="Author of the rating")
|
||||
rating = fields.Float(string="Rating", group_operator="avg", default=0, help="Rating value")
|
||||
rating = fields.Float(string="Rating", group_operator="avg", default=0, help="Rating value: 0=Unhappy, 10=Happy")
|
||||
feedback = fields.Text('Feedback reason', help="Reason of the rating")
|
||||
message_id = fields.Many2one('mail.message', string="Linked message", help="Associated message when posting a review. Mainly used in website addons.", index=True)
|
||||
access_token = fields.Char('Security Token', default=new_access_token, help="Access token to set the rating of the value")
|
||||
@@ -52,7 +52,7 @@ class RatingMixin(models.AbstractModel):
|
||||
_description = "Rating Mixin"
|
||||
|
||||
rating_ids = fields.One2many('rating.rating', 'res_id', string='Rating', domain=lambda self: [('res_model', '=', self._name)])
|
||||
rating_last_value = fields.Float('Last Value', related='rating_ids.rating', store=True)
|
||||
rating_last_value = fields.Float('Rating Last Value', related='rating_ids.rating', store=True)
|
||||
rating_count = fields.Integer('Rating count', compute="_compute_rating_count")
|
||||
|
||||
@api.multi
|
||||
|
||||
Reference in New Issue
Block a user