[IMP] change as per review
[odoo/odoo.git] / addons / crm_fundraising / crm_fundraising_view.xml
1 <?xml version="1.0"?>
2 <openerp>
3     <data>
4            <!-- Fund Raising Configuration Menu -->
5         <menuitem id="menu_config_fundrising" name="Fund Raising"
6             groups="base.group_no_one"
7             parent="base.menu_base_config" sequence="65" />
8
9         <!-- Fund Raising Categories Form View -->
10
11         <record id="crm_fund_categ_action" model="ir.actions.act_window">
12             <field name="name">Fundraising Categories</field>
13             <field name="res_model">crm.case.categ</field>
14             <field name="view_type">form</field>
15             <field name="view_id" ref="crm.crm_case_categ_tree-view"/>
16             <field name="domain">[('object_id.model', '=', 'crm.fundraising')]</field>
17             <field name="context" eval="{'object_id': ref('model_crm_fundraising')}"/>
18             <field name="help">Manage and define the fund raising categories you want to be maintained in the system.</field>
19         </record>
20
21         <menuitem action="crm_fund_categ_action" name="Categories"
22             id="menu_crm_case_fundraising-act" groups="base.group_no_one"
23             parent="menu_config_fundrising" />
24
25         <!-- Fund Stage Form View -->
26
27         <record id="crm_fundraising_stage_act" model="ir.actions.act_window">
28             <field name="name">Fundraising Stages</field>
29             <field name="res_model">crm.case.stage</field>
30             <field name="view_type">form</field>
31             <field name="view_id" ref="crm.crm_case_stage_tree"/>
32             <field name="context">{'search_default_fundraising':1}</field>
33             <field name="help">Create and manage fund raising activity categories you want to be maintained in the system.</field>
34         </record>
35
36         <!-- Fund Raising Tree View -->
37
38         <record model="ir.ui.view" id="crm_case_tree_view_fund">
39             <field name="name">CRM - Funds Tree</field>
40             <field name="model">crm.fundraising</field>
41             <field name="type">tree</field>
42             <field name="arch" type="xml">
43                 <tree string="Funds Tree"
44                     colors="blue:state=='pending';grey:state in ('cancel', 'done')">
45                     <field name="name" string="Fund Description" />
46                     <field name="categ_id" />
47                     <field name="type_id" string="Payment Mode" />
48                     <field name="planned_cost" string="Amount" />
49                     <field name="probability" />
50                     <field name="user_id" />
51                     <field name="state" />
52                     <field name="partner_id" invisible="1"/>
53                 </tree>
54             </field>
55         </record>
56
57         <!-- Fund Raising Form View -->
58
59         <record model="ir.ui.view" id="crm_case_form_view_fund">
60             <field name="name">CRM - Funds Form</field>
61             <field name="model">crm.fundraising</field>
62             <field name="type">form</field>
63             <field name="arch" type="xml">
64                 <form version="7.0">
65                 <header>
66                     <button name="case_close" string="Done" states="open,pending" type="object" class="oe_highlight"/>
67                     <button name="case_open" string="Open" states="draft,pending" type="object" class="oe_highlight"/>
68                     <button name="case_pending" string="Pending" states="draft,open" type="object" class="oe_highlight"/>
69                     <button name="case_escalate" string="Escalate" states="open,draft,pending" type="object" groups="base.group_extended" />
70                     <button name="case_reset" string="Reset to Draft" states="done,cancel" type="object" />
71                     <button name="case_cancel" string="Cancel" states="draft,open,pending" type="object" />
72                     <field name="state" widget="statusbar" nolabel="1" statusbar_visible="draft,open,done" statusbar_colors='{"pending":"blue"}'/>
73                 </header>
74                 <sheet string="Funds Form">
75                     <label for="name" class="oe_edit_only"/>
76                     <h1>
77                         <field name="name"/>
78                     </h1>
79                     <label for="categ_id" class="oe_edit_only"/>
80                     <h2>
81                         <field name="categ_id" widget="selection" domain="[('object_id.model', '=', 'crm.fundraising')]" class="oe_inline"/>
82                     </h2>
83                     <group>
84                         <group>
85                             <field name="user_id" string="Responsible"/>
86                             <field name="section_id" colspan="1" widget="selection"/>
87                         </group>
88                         <group>
89                             <field name="date"/>
90                             <field name="type_id" string="Payment Mode" widget="selection"/>
91                             <field name="priority" string="Priority"/>
92                         </group>
93                     </group>
94                     <notebook>
95                         <page string="Funds">
96                             <group>
97                                 <group>
98                                     <field name="partner_id"
99                                         on_change="onchange_partner_id(partner_id, email_from)"
100                                         />
101                                     <field name="email_from"/>
102                                 </group>
103                                 <group>
104                                     <field name="planned_cost"/>
105                                     <field name="planned_revenue"/>
106                                     <field name="probability"/>
107                                 </group>
108                             </group>
109                             <separator colspan="4" string="Notes"/>
110                             <field name="description" placeholder="Add a note..."/>
111                         </page>
112                         <page string="Extra Info">
113                             <group>
114                                 <group string="Misc">
115                                     <field name="active"/>
116                                     <field name="id"/>
117                                 </group>
118                                 <group groups="base.group_no_one" string="Dates">
119                                     <field name="create_date"/>
120                                     <field name="date_closed"/>
121                                     <field name="duration"/>
122                                 </group>
123                                 <group string="References">
124                                     <field name="ref"/>
125                                     <field name="ref2"/>
126                                 </group>
127                             </group>
128                         </page>
129                     </notebook>
130                 </sheet>
131                 <footer>
132                     <field name="message_ids" colspan="4" widget="mail_thread" nolabel="1"/>
133                 </footer>
134                 </form>
135             </field>
136         </record>
137
138         <!-- Fund Raising Calendar View -->
139
140         <record model="ir.ui.view" id="crm_case_calendar_view_fund">
141             <field name="name">CRM - Funds Calendar</field>
142             <field name="model">crm.fundraising</field>
143             <field name="type">calendar</field>
144             <field name="priority" eval="2"/>
145             <field name="arch" type="xml">
146                 <calendar string="Funds" date_start="date" color="user_id" date_delay="duration">
147                     <field name="name"/>
148                     <field name="partner_id"/>
149                 </calendar>
150             </field>
151         </record>
152
153         <!-- Fund Raising Graph View -->
154
155         <record model="ir.ui.view" id="crm_case_graph_view_fund">
156             <field name="name">CRM - Funds Graph</field>
157             <field name="model">crm.fundraising</field>
158             <field name="type">graph</field>
159             <field name="arch" type="xml">
160                 <graph string="Funds by Categories" type="bar" orientation="horizontal">
161                     <field name="categ_id"/>
162                     <field name="planned_cost" operator="+"/>
163                     <field name="state" group="True"/>
164                 </graph>
165             </field>
166         </record>
167
168         <!-- Fund Raising Search View -->
169         <record id="view_crm_case_fund_filter" model="ir.ui.view">
170                 <field name="name">CRM - Funds Search</field>
171                 <field name="model">crm.fundraising</field>
172                 <field name="type">search</field>
173                 <field name="arch" type="xml">
174                     <search string="Search Funds">
175                         <group>
176                             <field name="name" string="Fund Description"/>
177                             <separator orientation="vertical" />
178                             <filter icon="terp-check" string="New"
179                                 domain="[('state','=','draft')]" name="current"
180                                 help="New Funds" />
181                             <filter icon="terp-camera_test" string="Open"
182                                 domain="[('state','=','open')]"
183                                 help="Open Funds" />
184                             <filter icon="terp-gtk-media-pause"
185                                 string="Pending"
186                                 domain="[('state','=','pending')]"
187                                 help="Pending Funds" />
188                             <separator orientation="vertical" />
189                             <filter string="Unassigned"
190                                     icon="terp-personal-"
191                                     domain="[('user_id','=', False)]"
192                                     help="Unassigned" />
193                             <filter string="Assigned to Me or to My Sales Team(s)" 
194                                     icon="terp-personal+"
195                                     domain="['|', ('section_id.user_id','=',uid), ('section_id.member_ids', 'in', [uid])]"
196                                     help="Fund Raisings that are assigned to me or to one of the sale teams I manage" />
197                             <separator orientation="vertical" />
198                             <field name="state"/>
199                             <field name="user_id" 
200                                 widget="selection"/>
201                             <field name="section_id" widget="selection" string="Sales Team"/>
202                         </group>
203                         <newline/>
204                         <group expand="0" string="Group By...">
205                             <filter string="Partner" icon="terp-partner"
206                                 domain="[]"
207                                 context="{'group_by':'partner_id'}" />
208                             <filter string="Responsible" icon="terp-personal"
209                                 domain="[]"
210                                 context="{'group_by':'user_id'}" />
211                             <filter string="Category" help="Fund Category"
212                                 icon="terp-stock_symbol-selection" domain="[]"
213                                 context="{'group_by':'categ_id'}" />
214                             <filter string="Payment Mode" help="Payment Mode"
215                                 icon="terp-dolar" domain="[]"
216                                 context="{'group_by':'type_id'}" />
217                             <filter string="Status" icon="terp-stock_effects-object-colorize" domain="[]"
218                                 context="{'group_by':'state'}" />
219                         </group>
220                     </search>
221                 </field>
222             </record>
223     </data>
224 </openerp>