5 Views for im_chat.session
7 <!-- History : form, list and search views -->
8 <record id="action_session_history" model="ir.actions.act_window">
9 <field name="name">History</field>
10 <field name="res_model">im_chat.session</field>
11 <field name="view_type">form</field>
12 <field name="view_mode">list,form</field>
13 <field name="domain">[('channel_id', '!=', None)]</field>
14 <field name="context">{'group_by': ['channel_id', 'create_date:month']}</field>
17 <record id="im_chat_session_search" model="ir.ui.view">
18 <field name="name">im_chat.session.search</field>
19 <field name="model">im_chat.session</field>
20 <field name="arch" type="xml">
21 <search string="Search history">
22 <filter name="id" string="My sessions" domain="[('user_ids','in', uid)]"/>
23 <group expand="0" string="Group By...">
24 <filter name="group_by_channel" string="Channel" domain="[]" context="{'group_by':'channel_id'}"/>
25 <separator orientation="vertical" />
26 <filter name="group_by_day" string="Creation date (day)" domain="[]" context="{'group_by':'create_date:day'}"/>
27 <filter name="group_by_week" string="Creation date (week)" domain="[]" context="{'group_by':'create_date:week'}"/>
28 <filter name="group_by_month" string="Creation date (month)" domain="[]" context="{'group_by':'create_date:month'}" />
29 <filter name="group_by_year" string="Creation date (year)" domain="[]" context="{'group_by':'create_date:year'}"/>
35 <record id="im_chat_session_list_view" model="ir.ui.view">
36 <field name="name">im_chat.session.tree</field>
37 <field name="model">im_chat.session</field>
38 <field name="arch" type="xml">
39 <tree string="History" create="false">
41 <field name="fullname"/>
42 <field name="create_date"/>
43 <field name="feedback_rating"/>
48 <record id="im_chat_session_form_view" model="ir.ui.view">
49 <field name="name">im_chat.session.form</field>
50 <field name="model">im_chat.session</field>
51 <field name="arch" type="xml">
52 <form string="Session Form" create="false" edit="false">
54 <group string="General">
56 <field name="fullname" />
57 <field name="create_date" readonly="1"/>
59 <group string="Feedback">
60 <field name="feedback_rating"/>
61 <field name="feedback_reason"/>
63 <field name="message_ids" type="tree">
64 <tree string="History">
65 <field name="create_date" />
66 <field name="from_id" />
67 <field name="message" />
76 <!-- Session of a channel : list view -->
77 <record id="action_session_channel" model="ir.actions.act_window">
78 <field name="name">Sessions</field>
79 <field name="res_model">im_chat.session</field>
80 <field name="view_mode">list,form</field>
81 <field name="domain">[('channel_id','in',[active_id])]</field>
82 <field name="context">{
83 'search_default_channel_id': [active_id],
84 'default_channel_id': active_id,
86 <field name="search_view_id" ref="im_chat_session_search"/>
91 Views for im_livechat.channel
93 <record id="action_support_channels" model="ir.actions.act_window">
94 <field name="name">Live Chat Channels</field>
95 <field name="res_model">im_livechat.channel</field>
96 <field name="view_mode">kanban,form</field>
97 <field name="help" type="html">
98 <p class="oe_view_nocontent_create">
99 Click to define a new live chat channel.
101 You can create channels for each website on which you want
102 to integrate the live chat widget, allowing you website
103 visitors to talk in real time with your operators.
105 Each channel has it's own URL that you can send by email to
106 your customers in order to start chatting with you.
111 <record id="support_channel_kanban" model="ir.ui.view">
112 <field name="name">support_channel.kanban</field>
113 <field name="model">im_livechat.channel</field>
114 <field name="arch" type="xml">
117 <field name="web_page" widget="url"/>
118 <field name="are_you_inside"/>
119 <field name="user_ids"/>
120 <field name="nbr_session"/>
122 <t t-name="kanban-box">
123 <div class="oe_kanban_card oe_kanban_global_click">
124 <div class="oe_module_vignette row">
125 <div class="col-md-4">
126 <div class="oe_module_icon">
127 <img t-att-src="kanban_image('im_livechat.channel', 'image_medium', record.id.value)" class="img-responsive"/>
130 <div class="col-md-7">
131 <h3><field name="name"/></h3>
134 <i class="fa fa-user">
135 <t t-esc="(record.user_ids.raw_value || []).length"/> Operators
138 <i class="fa fa-comments">
139 <t t-esc="record.nbr_session.raw_value"/> Sessions
142 <div style="margin-top:5px;">
143 <button t-if="record.are_you_inside.raw_value" name="quit" type="object" class="btn btn-default btn-xs">Quit</button>
144 <button t-if="! record.are_you_inside.raw_value" name="join" type="object" class="btn btn-info btn-xs">Join</button>
156 <record id="support_channel_form" model="ir.ui.view">
157 <field name="name">support_channel.form</field>
158 <field name="model">im_livechat.channel</field>
159 <field name="arch" type="xml">
160 <form string="Support Channels" version="7.0">
162 <field name="image" widget='image' class="oe_avatar oe_left" options='{"preview_image": "image_medium"}'/>
163 <div class="oe_title">
164 <label for="name" class="oe_edit_only"/>
166 <field name="name" placeholder="e.g. YourWebsite.com"/>
169 <button type="object" name="join" class="oe_highlight" string="Join Channel" attrs='{"invisible": [["are_you_inside", "=", True]]}'/>
170 <button type="object" name="quit" string="Leave Channel" attrs='{"invisible": [["are_you_inside", "=", False]]}'/>
171 <button type="object" name="test_channel" string="Test" attrs='{"invisible": [["web_page", "=", False]]}'/>
172 <field name="are_you_inside" invisible="1"/>
175 <div class="oe_right oe_button_box" name="buttons">
176 <button class="oe_inline oe_stat_button" type="action" attrs="{'invisible':[('nbr_session','=', 0)]}" name="%(action_session_channel)d" icon="fa-comments">
177 <field string="Sessions" name="nbr_session" widget="statinfo"/>
181 <group string="Operators">
182 <field name="user_ids" widget="many2many_kanban" nolabel="1" colspan="2">
186 <t t-name="kanban-box">
188 <a t-if="! read_only_mode" type="delete" style="position: absolute; right: 0; padding: 4px; diplay: inline-block">X</a>
189 <div class="oe_group_details" style="min-height: 40px">
190 <img t-att-src="kanban_image('res.users', 'image', record.id.value)"
191 class="oe_avatar oe_kanban_avatar_smallbox" style="float:left; margin-right: 10px;"/>
192 <h4><field name="name"/></h4>
200 <group string="Options">
201 <field name="button_text"/>
202 <field name="input_placeholder"/>
203 <field name="default_message" placeholder="e.g. Hello, how may I help you?"/>
207 <div attrs='{"invisible": [["web_page", "=", False]]}'>
208 <separator string="How to use the Live Chat widget?"/>
210 Copy and paste this code into your website, within the &lt;head&gt; tag:
212 <field name="script_external" readonly="1" class="oe_tag"/>
214 or copy this url and send it by email to your customers or suppliers:
216 <field name="web_page" readonly="1" class="oe_tag" widget="url"/>
217 <p>For website built with Odoo CMS, please install the website_livechat module. Then go to Settings > Website Settings and select the Live Chat Channel you want to add on your website.</p>
220 <group string="Channel Rules">
221 <field name="rule_ids" nolabel="1"/>
231 Views for im_livechat_channel_rule
233 <record id="im_livechat_channel_rule_tree_view" model="ir.ui.view">
234 <field name="name">im.livechat.channel.rule.tree</field>
235 <field name="model">im_livechat.channel.rule</field>
236 <field name="arch" type="xml">
237 <tree string="Rules">
238 <field name="regex_url"/>
239 <field name="action"/>
240 <field name="country_ids"/>
245 <record id="im_livechat_channel_rule_form_view" model="ir.ui.view">
246 <field name="name">im_livechat.channel.rule.form</field>
247 <field name="model">im_livechat.channel.rule</field>
248 <field name="type">form</field>
249 <field name="arch" type="xml">
250 <form string="Channel Rule">
253 <field name="action"/>
254 <field name="regex_url" />
255 <field name="auto_popup_timer" />
258 <page string="Blocked Countries">
259 <field name="country_ids" />
269 <menuitem name="Live Chat" parent="mail.mail_feeds_main" id="im_livechat" groups="group_im_livechat"/>
271 <menuitem name="History" parent="im_livechat" id="session_history" action="action_session_history" groups="group_im_livechat"/>
273 <menuitem name="Channels" parent="im_livechat" id="support_channels" action="action_support_channels" groups="group_im_livechat"/>