[IMP]: Usability Improvements
[odoo/odoo.git] / addons / project_messages / project_messages_view.xml
1 <?xml version="1.0" encoding="utf-8"?>
2 <openerp>
3     <data>
4                 <record id="view_phase_project_form1" model="ir.ui.view">
5             <field name="name">phase.project.form1</field>
6             <field name="model">project.project</field>
7             <field name="type">form</field>
8             <field name="inherit_id" ref="project.edit_project"/>
9             <field name="arch" type="xml">
10                 <xpath expr="//page[@string='Tasks Stages']" position="after">
11                         <page string="Messages" groups="base.group_extended">
12                                 <field name="message_ids" nolabel="1" colspan="4">
13                                         <tree editable="1" string="Messages">
14                                         <field name="message" attrs="{'readonly':[('from_id', '!=', uid)]}"/>
15                                         <field name="from_id"/>
16                                         <field name="to_id" attrs="{'readonly':[('from_id', '!=', uid)]}"/>
17                                         </tree>
18                                         <form>
19                                                 <group attrs="{'readonly':[('from_id', '!=', uid)]}">
20                                                         <field name="from_id"/>
21                                                 <field name="to_id"/>
22                                                 <newline/>
23                                                 <separator colspan="4" string="Message"/>
24                                                 <field nolabel="1" name="message" colspan="4"/>
25                                         </group>
26                                         </form>
27                                 </field>
28                         </page>
29                 </xpath>
30             </field>
31         </record>
32
33          <record id="view_project_message_form" model="ir.ui.view">
34             <field name="name">project.messages.form</field>
35             <field name="model">project.messages</field>
36             <field name="type">form</field>
37             <field name="arch" type="xml">
38                 <form string="Messages">
39                         <group attrs="{'readonly':[('from_id', '!=', uid)]}">
40                         <field name="project_id" select="1" domain="[('user_id','=',uid)]"/>
41                         <field name="from_id" select="1"/>
42                         <field name="to_id" select="1"/>
43                         <newline/>
44                         <separator colspan="4" string="Message"/>
45                         <field name="message" colspan="4" nolabel="1"/>
46                      </group>
47                 </form>
48             </field>
49        </record>
50
51                 <record id="view_project_message_tree" model="ir.ui.view">
52             <field name="name">project.messages.tree</field>
53             <field name="model">project.messages</field>
54             <field name="type">tree</field>
55             <field name="arch" type="xml">
56                 <tree string="Messages">
57                         <field name="project_id"/>
58                         <field name="from_id"/>
59                         <field name="to_id"/>
60                 </tree>
61             </field>
62         </record>
63
64         <record id="view_project_messages_search" model="ir.ui.view">
65            <field name="name">project.messages.search</field>
66            <field name="model">project.messages</field>
67            <field name="type">search</field>
68            <field name="arch" type="xml">
69                <search string="Communication Messages">
70                         <group>
71                                 <field name="project_id"/>
72                         <field name="from_id"/>
73                         <field name="to_id"/>
74                         <field name="message"/>
75                         </group>
76                         <newline/>
77                     <group expand="0" string="Group By..." colspan="4" col="20">
78                         <filter string="Message To" icon="terp-personal" domain="[]" context="{'group_by':'to_id'}"/>
79                         <filter string="Message From" icon="terp-personal" domain="[]" context="{'group_by':'from_id'}"/>
80                         <separator orientation="vertical"/>
81                         <filter string="Project" icon="terp-folder-blue" domain="[]" context="{'group_by':'project_id'}"/>
82                     </group>
83                </search>
84            </field>
85         </record>
86
87         <record id="messages_form" model="ir.actions.act_window">
88             <field name="name">Communication Messages</field>
89             <field name="res_model">project.messages</field>
90             <field name="view_type">form</field>
91             <field name="search_view_id" ref="view_project_messages_search"/>
92             <field name="context">{"search_default_to_id":uid}</field>
93             <field name="view_id" ref="view_project_message_tree"/>
94                         <field name="help">An in-project messagery system permits an efficient and trackable communication between project members. The messages are kept in the system and can then be used for post-analysis.</field>
95         </record>
96
97         <act_window domain="[('project_id', '=', active_id)]" id="act_project_messages" name="Messages" res_model="project.messages" src_model="project.project"/>
98
99          <!--Actions for deshboard -->
100
101         <record id="action_view_project_editable_messages_tree" model="ir.actions.act_window">
102             <field name="name">Messages</field>
103             <field name="res_model">project.messages</field>
104             <field name="view_type">form</field>
105             <field name="view_mode">tree,form</field>
106             <field name="view_id" ref="project_messages.view_project_message_tree"/>
107        </record>
108        <menuitem action="messages_form" id="menu_messages_form" parent="project.menu_project_management"/>
109      </data>
110 </openerp>