Files
odoo_source/addons/mail/views/mail_channel_views.xml
T
Gert PellinandRichard Mathot 76a557c9ac [IMP] hr,mail: auto-subscribe departments to channels
Purpose of this commit is to allow to make private channels linked to
an HR department with an auto subscription.

It will ease the use of discussion channels among employees of a given
department. Moreover auto subscription is useful to avoid having to
manually synchronize channel members and department members.

This commit is linked to task ID 1848526 and closes PR #26650 .

Co-authored-by: Gert Pellin <gpe@odoo.com>
Co-authored-by: Richard Mathot <rim@odoo.com>
2018-09-17 13:56:39 +02:00

227 lines
12 KiB
XML

<?xml version="1.0"?>
<odoo>
<data>
<!-- mail.channel.partner -->
<record id="mail_channel_partner_view_tree" model="ir.ui.view">
<field name="name">mail.channel.partner.tree</field>
<field name="model">mail.channel.partner</field>
<field name="priority">10</field>
<field name="arch" type="xml">
<tree string="Channels">
<field name="partner_id"/>
<field name="channel_id"/>
<field name="seen_message_id"/>
</tree>
</field>
</record>
<record id="mail_channel_partner_view_form" model="ir.ui.view">
<field name="name">mail.channel.partner.form</field>
<field name="model">mail.channel.partner</field>
<field name="arch" type="xml">
<form string="Channel">
<sheet>
<group>
<field name="partner_id"/>
<field name="channel_id"/>
<field name="seen_message_id"/>
</group>
</sheet>
</form>
</field>
</record>
<record id="mail_channel_partner_action" model="ir.actions.act_window">
<field name="name">Channels/Partner</field>
<field name="res_model">mail.channel.partner</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
</record>
<menuitem name="Channels/Partner" id="mail_channel_partner_menu" parent="base.menu_email"
action="mail_channel_partner_action" sequence="92" groups="base.group_no_one"/>
<!-- mail.channel -->
<record id="mail_channel_view_kanban" model="ir.ui.view">
<field name="name">mail.channel.kanban</field>
<field name="model">mail.channel</field>
<field name="priority" eval="10"/>
<field name="arch" type="xml">
<kanban>
<field name="id"/>
<field name="description"/>
<field name="is_subscribed"/>
<field name="group_ids"/>
<field name="public"/>
<templates>
<t t-name="kanban-description">
<div class="oe_group_description" t-if="record.description.raw_value">
<field name="description"/>
</div>
</t>
<t t-name="kanban-box">
<div class="oe_module_vignette oe_kanban_global_click">
<img t-att-src="kanban_image('mail.channel', 'image_medium', record.id.raw_value)" class="oe_module_icon" alt="Channel"/>
<div class="oe_module_desc">
<h4 class="o_kanban_record_title">#<field name="name"/></h4>
<p class="oe_module_name">
<field name="description"/>
</p>
<button type="object" attrs="{'invisible':['|', ('is_subscribed','=',True), ('group_ids', '!=', [])]}" class="btn btn-primary float-right" name="channel_join_and_get_info">Join</button>
<button type="object" attrs="{'invisible':['|', ('is_subscribed','=',False), ('group_ids', '!=', [])]}" class="btn btn-secondary float-right" name="action_unfollow">Leave</button>
</div>
</div>
</t>
</templates>
</kanban>
</field>
</record>
<record id="mail_channel_view_form" model="ir.ui.view">
<field name="name">mail.channel.form</field>
<field name="model">mail.channel</field>
<field name="priority" eval="10"/>
<field name="arch" type="xml">
<form string="Mail Channel Form">
<header>
<button name="send_guidelines" type="object" string="Send guidelines" confirm="You are going to send the guidelines to all the subscribers. Do you confirm the action?" attrs="{'invisible':['|',('moderation_guidelines','=',False), ('is_moderator', '=', False)]}"/>
</header>
<sheet>
<div class="oe_button_box" name="button_box">
<field name="is_moderator" invisible="1"/>
<button class="btn oe_stat_button" name="mail.mail_moderation_action" type="action" attrs="{'invisible':[('is_moderator', '=', False)]}" icon="fa-bars" context="{'search_default_channel_id': active_id}">
<field string="Ban List" name="moderation_count" widget="statinfo"/>
</button>
</div>
<div class="oe_button_box" name="button_box"/>
<field name="image" widget="image" class="oe_avatar" options="{'preview_image': 'image_medium', 'size': [90, 90]}"/>
<div class="oe_title">
<div class="oe_edit_only">
<label for="name"/>
</div>
<h1>
#<field name="name" default_focus="1" placeholder="Name" readonly="0"/>
</h1>
</div>
<group class="o_label_nowrap">
<field name="email_send"/>
<field name="moderation" attrs="{'invisible': [('email_send', '=', False)]}"/>
<field name="description" placeholder="Topics discussed in this group..."/>
</group>
<group name="group_alias" attrs="{'invisible': [('alias_domain', '=', False)]}">
<label for="alias_id" string=" " class="fa fa-envelope-o" style="min-width: 20px;" aria-label="Email" title="Email" role="img"/>
<div name="alias_def">
<field name="alias_id" class="oe_read_only oe_inline"
string="Email Alias" required="0"/>
<div class="oe_edit_only oe_inline" name="edit_alias" style="display: inline;" >
<field name="alias_name" class="oe_inline"/>@<field name="alias_domain" class="oe_inline" readonly="1"/>
</div>
</div>
<field name="alias_contact" class="oe_inline" invisible="1"/>
</group>
<notebook>
<page string="Privacy">
<group class="o_label_nowrap">
<field name="public" widget="radio" string="Who can follow the group's activities?"/>
<field name="group_public_id"
attrs="{'invisible': [('public','!=','groups')], 'required': [('public','=','groups')]}"
/>
<field name="group_ids" widget="many2many_tags"
string="Auto Subscribe Groups"/>
</group>
</page>
<page string="Members">
<field name="channel_last_seen_partner_ids" mode="tree" context="{'active_test': False}">
<tree string="Members" editable="bottom">
<field name="partner_id"/>
<field name="partner_email" readonly="1"/>
</tree>
</field>
</page>
<page string="Moderation" attrs="{'invisible': [('moderation', '=', False)]}">
<group>
<field name="moderator_ids" widget="many2many_tags"/>
<field name="moderation_notify"/>
<field name="moderation_notify_msg" attrs="{'invisible': [('moderation_notify', '=', False)]}"/>
<field name="moderation_guidelines"/>
<field name="moderation_guidelines_msg" attrs="{'invisible':[('moderation_guidelines', '=', False)]}"/>
</group>
</page>
<page string="Integrations" invisible="0" name="mail_channel_integrations"></page>
</notebook>
<div class="oe_chatter" groups="base.group_no_one">
<field name="message_follower_ids" widget="mail_followers"/>
</div>
</sheet>
</form>
</field>
</record>
<record id="mail_channel_view_tree" model="ir.ui.view">
<field name="name">mail.channel.tree</field>
<field name="model">mail.channel</field>
<field name="priority" eval="10"/>
<field name="arch" type="xml">
<tree string="Groups">
<field name="name"/>
</tree>
</field>
</record>
<record id="mail_channel_view_search" model="ir.ui.view">
<field name="name">mail.channel.search</field>
<field name="model">mail.channel</field>
<field name="priority" eval="10"/>
<field name="arch" type="xml">
<search string="Search Groups">
<field name="name"/>
</search>
</field>
</record>
<record id="mail_channel_action_view" model="ir.actions.act_window">
<field name="name">Join a group</field>
<field name="res_model">mail.channel</field>
<field name="view_type">form</field>
<field name="view_mode">kanban,tree,form</field>
<field name="search_view_id" ref="mail_channel_view_search"/>
</record>
<!-- settings !-->
<menuitem id="mail_channel_menu_settings" parent="base.menu_email" sequence="90"
name="Channels" action="mail_channel_action_view"
groups="base.group_no_one"/>
<record id="action_discuss" model="ir.actions.client">
<field name="name">Discuss</field>
<field name="tag">mail.discuss</field>
<field name="res_model">mail.channel</field>
<field name="params" eval="&quot;{
'default_active_id': 'mailbox_inbox'
}&quot;"/>
</record>
<menuitem
id="mail.menu_root_discuss"
name="Discuss"
action="action_discuss"
web_icon="mail,static/description/icon.png"
groups="base.group_user"
sequence="1"/>
<!--
This menuitem will be activated by integrations modules (like github, twitter, ...). It
is a hook to ease other modules to plug into mail.
-->
<record id="mail.mail_channel_integrations_menu" model="ir.ui.menu">
<field name="name">Integrations</field>
<field name="parent_id" ref="mail.menu_root_discuss"></field>
<field name="active" eval="False"></field>
</record>
</data>
</odoo>