187 lines
12 KiB
XML
187 lines
12 KiB
XML
|
<?xml version="1.0"?>
|
||
|
<odoo>
|
||
|
<data>
|
||
|
|
||
|
<record id="discuss_channel_view_search" model="ir.ui.view">
|
||
|
<field name="name">discuss.channel.search</field>
|
||
|
<field name="model">discuss.channel</field>
|
||
|
<field name="arch" type="xml">
|
||
|
<search string="Search history">
|
||
|
<field name="name" string="Participant"/>
|
||
|
<filter name="filter_my_sessions" domain="[('is_member', '=', True)]" string="My Sessions"/>
|
||
|
<separator/>
|
||
|
<filter name="filter_session_date" date="create_date" string="Session Date"/>
|
||
|
<separator/>
|
||
|
<filter name="filter_session_bad_rating" domain="[('rating_ids', '!=', False), ('rating_avg', '<', 2.5)]" string="Bad Ratings"/>
|
||
|
<filter name="filter_session_good_rating" domain="[('rating_ids', '!=', False), ('rating_avg', '>=', 2.5)]" string="Good Ratings"/>
|
||
|
<filter name="fiter_session_unrated" domain="[('rating_ids', '=', False)]" string="Unrated"/>
|
||
|
<group expand="0" string="Group By...">
|
||
|
<filter name="group_by_channel" string="Channel" domain="[]" context="{'group_by':'livechat_channel_id'}"/>
|
||
|
<separator orientation="vertical"/>
|
||
|
<filter name="group_by_month" string="Session Date" domain="[]" context="{'group_by':'create_date:month'}"/>
|
||
|
</group>
|
||
|
</search>
|
||
|
</field>
|
||
|
</record>
|
||
|
|
||
|
<record id="discuss_channel_view_tree" model="ir.ui.view">
|
||
|
<field name="name">discuss.channel.tree</field>
|
||
|
<field name="model">discuss.channel</field>
|
||
|
<field name="arch" type="xml">
|
||
|
<tree js_class="im_livechat.discuss_channel_list" string="History" create="false" default_order="create_date desc">
|
||
|
<field name="is_member" column_invisible="True"/>
|
||
|
<field name="create_date" string="Session Date"/>
|
||
|
<field name="name" string="Participants"/>
|
||
|
<field name="country_id"/>
|
||
|
<field name="duration" widget="float_time" options="{'displaySeconds': True}"/>
|
||
|
<field name="message_ids" string="# Messages"/>
|
||
|
<field name="rating_last_image" string="Rating" widget="image" options='{"size": [20, 20]}' class="bg-view"/>
|
||
|
</tree>
|
||
|
</field>
|
||
|
</record>
|
||
|
|
||
|
<record id="discuss_channel_view_form" model="ir.ui.view">
|
||
|
<field name="name">discuss.channel.form</field>
|
||
|
<field name="model">discuss.channel</field>
|
||
|
<field name="arch" type="xml">
|
||
|
<form string="Session Form" create="false" edit="false">
|
||
|
<sheet>
|
||
|
<div style="width:50%" class="float-end">
|
||
|
<field name="rating_last_image" widget="image" class="float-end bg-view" readonly="1" nolabel="1"/>
|
||
|
<field name="rating_last_feedback" nolabel="1"/>
|
||
|
</div>
|
||
|
<div style="width:50%" class="float-start">
|
||
|
<group>
|
||
|
<field name="name" string="Participants"/>
|
||
|
<field name="create_date" readonly="1" string="Session Date"/>
|
||
|
</group>
|
||
|
</div>
|
||
|
|
||
|
<group string="History" class="o_history_container">
|
||
|
<div class="o_history_kanban_container w-100 p-3" colspan="2">
|
||
|
<div class="o_history_kanban_sub_container">
|
||
|
<field name="message_ids" mode="kanban">
|
||
|
<kanban default_order="create_date DESC">
|
||
|
<field name="author_id"/>
|
||
|
<field name="author_guest_id"/>
|
||
|
<field name="body"/>
|
||
|
<field name="create_date"/>
|
||
|
<field name="id"/>
|
||
|
<field name="author_avatar"/>
|
||
|
<field name="parent_author_name"/>
|
||
|
<field name="parent_body"/>
|
||
|
<templates>
|
||
|
<t t-name="kanban-box">
|
||
|
<div class="oe_module_vignette p-3 d-flex flex-column">
|
||
|
<t t-set="isMessageReply" t-value="!!record.parent_author_name.raw_value"/>
|
||
|
<div t-if="isMessageReply" class="d-flex justify-content-between mb-2">
|
||
|
<div class="text-muted" style="width: fit-content;">
|
||
|
<i class="fa fa-mail-reply me-2" title="Reply"/>
|
||
|
<strong>
|
||
|
<t t-if="record.author_id.raw_value">
|
||
|
<field name="author_id"/>
|
||
|
</t>
|
||
|
<t t-else="">
|
||
|
<field name="author_guest_id"/>
|
||
|
</t>
|
||
|
</strong>
|
||
|
Replied to
|
||
|
<strong>
|
||
|
<field name="parent_author_name"/>
|
||
|
</strong>
|
||
|
<div class="o-livechat-HistoryKanban-body bg-200 p-2 rounded">
|
||
|
<field name="parent_body" widget="html"/>
|
||
|
</div>
|
||
|
</div>
|
||
|
<field class="d-none d-sm-block flex-shrink-0" name="date"/>
|
||
|
</div>
|
||
|
<div class="d-flex" t-att-class="{'ms-3': isMessageReply}">
|
||
|
<t t-if="record.author_avatar.raw_value">
|
||
|
<img t-att-src="kanban_image('mail.message', 'author_avatar', record.id.raw_value)" alt="Avatar" class="o_image_64_cover o-livechat-HistoryKanban-authorAvatar rounded"/>
|
||
|
</t>
|
||
|
<t t-else=""><img alt="Anonymous" src="/mail/static/src/img/smiley/avatar.jpg" class="o_image_64_cover o-livechat-HistoryKanban-authorAvatar rounded"/></t>
|
||
|
<div class="ms-2 flex-grow-1">
|
||
|
<p class="m-0"><strong>
|
||
|
<t t-if="record.author_id.raw_value"><field name="author_id"/></t>
|
||
|
<t t-else=""><field name="author_guest_id"/></t>
|
||
|
</strong></p>
|
||
|
<p class="m-0 o-livechat-HistoryKanban-body">
|
||
|
<t t-if="record.body.raw_value"><field name="body" widget="html"/></t>
|
||
|
</p>
|
||
|
</div>
|
||
|
<field t-if="!isMessageReply" class="d-none d-sm-block flex-shrink-0" name="date"/>
|
||
|
</div>
|
||
|
<field class="align-self-end d-block d-sm-none" name="date"/>
|
||
|
</div>
|
||
|
</t>
|
||
|
</templates>
|
||
|
</kanban>
|
||
|
</field>
|
||
|
</div>
|
||
|
</div>
|
||
|
</group>
|
||
|
</sheet>
|
||
|
</form>
|
||
|
</field>
|
||
|
</record>
|
||
|
|
||
|
|
||
|
<record id="discuss_channel_action" model="ir.actions.act_window">
|
||
|
<field name="name">History</field>
|
||
|
<field name="res_model">discuss.channel</field>
|
||
|
<field name="view_mode">tree,form</field>
|
||
|
<field name="search_view_id" ref="im_livechat.discuss_channel_view_search"/>
|
||
|
<field name="domain">[('livechat_channel_id', '!=', None)]</field>
|
||
|
<field name="context">{'search_default_session_not_empty': 1}</field>
|
||
|
<field name="help" type="html">
|
||
|
<p class="o_view_nocontent_empty_folder">
|
||
|
Your chatter history is empty
|
||
|
</p><p>
|
||
|
Create a channel and start chatting to fill up your history.
|
||
|
</p>
|
||
|
</field>
|
||
|
</record>
|
||
|
<record id="discuss_channel_action_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.discuss_channel_view_tree"/>
|
||
|
<field name="act_window_id" ref="im_livechat.discuss_channel_action"/>
|
||
|
</record>
|
||
|
|
||
|
<record id="discuss_channel_action_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.discuss_channel_view_form"/>
|
||
|
<field name="act_window_id" ref="im_livechat.discuss_channel_action"/>
|
||
|
</record>
|
||
|
|
||
|
|
||
|
<record id="discuss_channel_action_from_livechat_channel" model="ir.actions.act_window">
|
||
|
<field name="name">Sessions</field>
|
||
|
<field name="res_model">discuss.channel</field>
|
||
|
<field name="view_mode">tree,form</field>
|
||
|
<field name="domain">[('livechat_channel_id', 'in', [active_id]), ('has_message', '=', True)]</field>
|
||
|
<field name="context">{
|
||
|
'search_default_livechat_channel_id': [active_id],
|
||
|
'default_livechat_channel_id': active_id,
|
||
|
}</field>
|
||
|
<field name="search_view_id" ref="discuss_channel_view_search"/>
|
||
|
</record>
|
||
|
<record id="discuss_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.discuss_channel_view_tree"/>
|
||
|
<field name="act_window_id" ref="im_livechat.discuss_channel_action_from_livechat_channel"/>
|
||
|
</record>
|
||
|
|
||
|
<record id="discuss_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.discuss_channel_view_form"/>
|
||
|
<field name="act_window_id" ref="im_livechat.discuss_channel_action_from_livechat_channel"/>
|
||
|
</record>
|
||
|
|
||
|
|
||
|
</data>
|
||
|
</odoo>
|