[FIX] im_livechat : send rating to the operator once the anonymous person close its conversation.
This commit is contained in:
@@ -56,5 +56,25 @@
|
||||
</record>
|
||||
|
||||
|
||||
<!-- Smiley for rating to be displayed in the conversation -->
|
||||
<record id="im_livechat_rating_0" model="im_chat.shortcode">
|
||||
<field name="source">:rating_0</field>
|
||||
<field name="substitution"><img src='/rating/static/src/img/rating_0.png'/></field>
|
||||
<field name="description">Rating Smiley Bad</field>
|
||||
</record>
|
||||
|
||||
<record id="im_livechat_rating_5" model="im_chat.shortcode">
|
||||
<field name="source">:rating_5</field>
|
||||
<field name="substitution"><img src='/rating/static/src/img/rating_5.png'/></field>
|
||||
<field name="description">Rating Smiley Okay</field>
|
||||
</record>
|
||||
|
||||
<record id="im_livechat_rating_10" model="im_chat.shortcode">
|
||||
<field name="source">:rating_10</field>
|
||||
<field name="substitution"><img src='/rating/static/src/img/rating_10.png'/></field>
|
||||
<field name="description">Rating Smiley Good</field>
|
||||
</record>
|
||||
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
@@ -267,6 +267,7 @@
|
||||
return openerp.session.rpc("/rating/livechat/feedback", {uuid: uuid, rate: this.rating, reason : this.reason}).then(function(res) {
|
||||
if(close){
|
||||
self.trigger("feedback_sent"); // will close the conversation
|
||||
self.conversation.send_message(_.str.sprintf(_t("I rated you with :rating_%d"), self.rating), "message");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -7,14 +7,13 @@
|
||||
<field name="arch" type="xml">
|
||||
<kanban create="false" class="oe_background_grey">
|
||||
<field name="rating"/>
|
||||
<field name="res_id"/>
|
||||
<field name="res_model"/>
|
||||
<field name="res_name"/>
|
||||
<field name="create_date"/>
|
||||
<field name="partner_id"/>
|
||||
<field name="rated_partner_id"/>
|
||||
<field name="feedback"/>
|
||||
<!-- those 2 are required to redirect to the view form object, in JS -->
|
||||
<field name="res_id"/>
|
||||
<field name="res_model"/>
|
||||
<templates>
|
||||
<t t-name="kanban-box">
|
||||
<div class="oe_kanban_card oe_kanban_global_click">
|
||||
|
||||
Reference in New Issue
Block a user