[FIX] Do not focus unfocusable fields
[odoo/odoo.git] / addons / mail / mail_group_view.xml
1 <?xml version="1.0"?>
2 <openerp>
3     <data>
4
5         <!-- Group Kanban View  !-->
6         <record model="ir.ui.view" id="view_group_kanban">
7             <field name="name">mail.group.kanban</field>
8             <field name="model">mail.group</field>
9             <field name="type">kanban</field>
10             <field name="priority" eval="10"/>
11             <field name="arch" type="xml">
12                 <kanban>
13                     <templates>
14                         <t t-name="kanban-description">
15                             <div class="oe_group_description" t-if="record.description.raw_value">
16                                 <field name="description"/>
17                             </div>
18                         </t>
19                         <t t-name="kanban-box">
20                             <div t-attf-class="{record.is_subscriber.raw_value} oe_group_vignette">
21                                 <div class="oe_group_image">
22                                     <a type="edit"><img t-att-src="kanban_image('mail.group', 'photo', record.id.value)" class="oe_group_photo" tooltip="kanban-description"/></a>
23                                 </div>
24                                 <div class="oe_group_details">
25                                     <h4><a type="edit"><field name="name"/></a></h4>
26                                     <span style="display: none;"><field name="is_subscriber"/></span>
27                                     <ul>
28                                         <li><field name="member_count"/> members</li>
29                                         <li t-if="! record.is_subscriber.raw_value"><a name="action_group_join" string="Join" type="object" class="oe_group_join">Not following</a></li>
30                                         <li t-if="record.is_subscriber.raw_value"><a name="action_group_leave" string="Join" type="object" class="oe_group_leave">Following</a></li>
31                                         <li><field name="last_month_msg_nbr"/> messages last month</li>
32                                     </ul>
33                                 </div>
34                             </div>
35                             <script>
36                                 $('.oe_group_photo').load(function() { if($(this).width() > $(this).height()) { $(this).addClass('oe_group_photo_wide') } });
37                                 $('.oe_group_join').mouseover(function () { $(this).html('Follow'); }).mouseleave(function () { $(this).html('Not following'); });
38                                 $('.oe_group_leave').mouseover(function () { $(this).html('Unfollow'); }).mouseleave(function () { $(this).html('Following'); });
39                             </script>
40                         </t>
41                     </templates>
42                 </kanban>
43             </field>
44         </record>
45
46         <!-- Group Form View !-->
47         <record  model="ir.ui.view" id="view_group_form">
48             <field name="name">mail.group.form</field>
49             <field name="model">mail.group</field>
50             <field name="type">form</field>
51             <field name="priority" eval="10"/>
52             <field name="arch" type="xml">
53                 <form string="Group Form" version="7.0">
54                     <sheet class="openerp_mail_group_sheet">
55                         <group colspan="4" col="8">
56                             <group colspan="1" col="2">
57                                 <field name="photo" widget='image' nolabel="1" on_change="onchange_photo(photo)"/>
58                             </group>
59                             <group colspan="7" col="6">
60                                 <div class="oe_edit_only">
61                                     <label for="name"/> 
62                                 </div> 
63                                 <h2><field name="name" colspan="4"/></h2>
64                                 <newline/>
65                                 <group colspan="4" col="4">
66                                     <field name="description" colspan="4" nolabel="1"/>
67                                     <field name="group_ids" colspan="4" widget="many2many_tags" class="oe_edit_only"/>
68                                 </group>
69                                 <group colspan="2" col="2" class="oe_edit_only">
70                                     <field name="responsible_id" colspan="2"/>
71                                     <field name="public" colspan="2"/>
72                                 </group>
73                             </group>
74                         </group>
75                     </sheet>
76                     <div class="oe_chatter oe_mail_group_footer">
77                         <field name="message_ids" widget="mail_thread"
78                                 options='{"thread_level": 1}'/>
79                     </div>
80                 </form>
81             </field>
82         </record>
83
84         <!-- Group List View !-->
85         <record  model="ir.ui.view" id="view_group_tree">
86             <field name="name">mail.group.tree</field>
87             <field name="model">mail.group</field>
88             <field name="type">tree</field>
89             <field name="priority" eval="10"/>
90             <field name="arch" type="xml">
91                 <tree string="Groups">
92                     <field name="name"/>
93                     <field name="responsible_id"/>
94                 </tree>
95             </field>
96         </record>
97
98         <!-- Group Search View !-->
99         <record  model="ir.ui.view" id="view_group_search">
100             <field name="name">mail.group.search</field>
101             <field name="model">mail.group</field>
102             <field name="type">search</field>
103             <field name="priority" eval="10"/>
104             <field name="arch" type="xml">
105                 <search string="Search Groups">
106                     <field name="name" string="Group"/>
107                     <field name="responsible_id"/>
108                 </search>
109             </field>
110         </record>
111
112         <!-- group record !-->
113         <record id="action_view_groups" model="ir.actions.act_window">
114             <field name="name">Groups</field>
115             <field name="res_model">mail.group</field>
116             <field name="view_type">form</field>
117             <field name="view_mode">kanban,tree,form</field>
118             <field name="search_view_id" ref="view_group_search"/>
119         </record>
120
121         <!-- left-side menu: Groups !-->
122         <menuitem id="mail_allgroups" name="All Groups" parent="mail_feeds" sequence="12" action="action_view_groups"/>
123     </data>
124 </openerp>