summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFabien Pinckaers <fp@openerp.com>2016-07-15 15:13:17 +0200
committerFabien Pinckaers <fp@openerp.com>2016-07-15 15:13:17 +0200
commit9bf9eb863b26ea7d24168f3e62ca1202c3130317 (patch)
tree99129ea04e55d6f4fc4ee54294f73126d8079f9a
parenteee72c838072d376488cddea8be8796b95f2daf7 (diff)
[FIX] rating: correct list view (list --> tree)
[FIX] livechat_rating: ratings from livechat should be consumed (otherwise invisible) [IMP] usability: better views and tooltips
-rw-r--r--addons/im_livechat/controllers/main.py1
-rw-r--r--addons/im_livechat/report/im_livechat_report_channel_views.xml7
-rw-r--r--addons/im_livechat/report/im_livechat_report_operator.py2
-rw-r--r--addons/im_livechat/views/im_livechat_channel_views.xml22
-rw-r--r--addons/im_livechat/views/mail_channel_views.xml17
-rw-r--r--addons/rating/models/rating.py4
6 files changed, 38 insertions, 15 deletions
diff --git a/addons/im_livechat/controllers/main.py b/addons/im_livechat/controllers/main.py
index c80630deff3..aa0e7a6a4f2 100644
--- a/addons/im_livechat/controllers/main.py
+++ b/addons/im_livechat/controllers/main.py
@@ -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({
diff --git a/addons/im_livechat/report/im_livechat_report_channel_views.xml b/addons/im_livechat/report/im_livechat_report_channel_views.xml
index 9df7cd8ec77..73c31f00299 100644
--- a/addons/im_livechat/report/im_livechat_report_channel_views.xml
+++ b/addons/im_livechat/report/im_livechat_report_channel_views.xml
@@ -59,13 +59,6 @@
</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"
parent="menu_reporting_livechat"
diff --git a/addons/im_livechat/report/im_livechat_report_operator.py b/addons/im_livechat/report/im_livechat_report_operator.py
index 7a15c90ef11..b29e367559d 100644
--- a/addons/im_livechat/report/im_livechat_report_operator.py
+++ b/addons/im_livechat/report/im_livechat_report_operator.py
@@ -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")
diff --git a/addons/im_livechat/views/im_livechat_channel_views.xml b/addons/im_livechat/views/im_livechat_channel_views.xml
index e2c0a2928cf..df19f06e5c1 100644
--- a/addons/im_livechat/views/im_livechat_channel_views.xml
+++ b/addons/im_livechat/views/im_livechat_channel_views.xml
@@ -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"/>
diff --git a/addons/im_livechat/views/mail_channel_views.xml b/addons/im_livechat/views/mail_channel_views.xml
index edc085c80c8..fc86605a641 100644
--- a/addons/im_livechat/views/mail_channel_views.xml
+++ b/addons/im_livechat/views/mail_channel_views.xml
@@ -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>
diff --git a/addons/rating/models/rating.py b/addons/rating/models/rating.py
index 9c87139d380..9df19846f77 100644
--- a/addons/rating/models/rating.py
+++ b/addons/rating/models/rating.py
@@ -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