[IMP] Changed all module categories, limited number of categories
[odoo/odoo.git] / addons / crm / crm_phonecall_view.xml
1 <?xml version="1.0"?>
2 <openerp>
3     <data>
4
5 <!--  Phonecall Categories Form View  -->
6
7     <record id="crm_phonecall_categ_action" model="ir.actions.act_window">
8         <field name="name">Phonecall Categories</field>
9         <field name="res_model">crm.case.categ</field>
10         <field name="view_type">form</field>
11         <field name="view_id" ref="crm.crm_case_categ_tree-view"/>
12         <field name="domain">[('object_id.model', '=', 'crm.phonecall')]</field>
13         <field name="context">{'object_id':'crm.phonecall'}</field>
14         <field name="help">Create specific phone call categories to better define the type of calls tracked in the system.</field>
15     </record>
16
17     <menuitem action="crm_phonecall_categ_action" name="Categories"
18         id="menu_crm_case_phonecall-act" parent="menu_crm_config_phonecall" />
19
20 <!--  PhoneCalls Tree View -->
21
22     <record model="ir.ui.view" id="crm_case_phone_tree_view">
23         <field name="name">CRM - Phone Calls Tree</field>
24         <field name="model">crm.phonecall</field>
25         <field name="type">tree</field>
26         <field name="arch" type="xml">
27             <tree colors="gray:state in ('cancel','done');blue:state in ('pending',)" string="Phone Calls">
28                 <field name="date"/>
29                 <field name="name"/>
30                 <field name="partner_id"/>
31                 <field name="partner_contact"/>
32                 <field name="partner_phone"/>
33                 <field name="user_id"/>
34                 <field name="categ_id" string="Type"/>
35                 <field name="create_date" invisible="1"/>
36                 <button string="Convert to Opportunity"
37                     name="%(phonecall2opportunity_act)d"
38                     states="draft,open,pending"
39                     icon="gtk-index"
40                     type="action" attrs="{'invisible':[('opportunity_id','!=',False)]}" />
41                 <button string="Meeting"
42                     states="draft,open,pending" icon="gtk-redo"
43                      name="action_make_meeting" type="object" />
44                 <field name="state"/>
45                 <button name="case_cancel" string="Cancel" states="draft,open,pending" type="object" icon="gtk-cancel"/>
46                 <button name="case_open" string="Open" states="draft,pending" type="object" icon="gtk-go-forward"/>
47                 <button name="case_close" string="Held" states="open,draft,pending" type="object" icon="gtk-jump-to"/>
48                 <button name="case_pending" string="Not Held" states="open" type="object" icon="gtk-media-pause"/>
49             </tree>
50         </field>
51     </record>
52
53 <!-- Phonecalls Form View -->
54
55     <record model="ir.ui.view" id="crm_case_phone_form_view">
56         <field name="name">CRM - Phone Call Form</field>
57         <field name="model">crm.phonecall</field>
58         <field name="type">form</field>
59         <field name="arch" type="xml">
60             <form string="Phone Call">
61                  <group colspan="6" col="7">
62                     <field name="name" required="1"/>
63                     <field name="partner_phone"/>
64                     <field name="duration" widget="float_time" required="1"/>
65                     <button string="Schedule a Meeting" name="action_make_meeting" icon="gtk-redo" type="object"/>
66
67                     <field name="date" required="1"/>
68                     <field name="user_id"/>
69                     <field name="section_id" colspan="1" widget="selection" />
70                     <button string="Convert to Opportunity"
71                         name="%(phonecall2opportunity_act)d"
72                         icon="gtk-index" type="action"
73                         attrs="{'invisible':[('opportunity_id','!=',False)]}" />
74                     <label colspan="6"  string=""/>
75                     <button string="Schedule Other Call"
76                      icon="terp-call-start"
77                     name="%(phonecall_to_phonecall_act)d"
78                     type="action"  />
79
80                 </group>
81
82                 <group col="3" colspan="2">
83                     <separator colspan="3" string="Contacts" />
84                     <field name="partner_id"
85                         on_change="onchange_partner_id(partner_id)" />
86                     <button string="Create a Partner"
87                         icon="terp-partner"
88                         name="%(action_crm_phonecall2partner)d"
89                         type="action"
90                         attrs="{'invisible':[('partner_id','!=',False)]}" 
91                         groups="base.group_partner_manager"/>
92                     <newline/>
93                     <field name="partner_address_id"
94                         on_change="onchange_partner_address_id(partner_address_id)" />
95                     <newline/>
96                     <field name="partner_mobile" />
97                 </group>
98                 <group col="2" colspan="2">
99                     <separator colspan="2" string="Categorization" />
100                     <field name="categ_id" widget="selection"
101                         domain="[('object_id.model', '=', 'crm.phonecall')]"
102                         string="Type" />
103                     <field name="priority"/>
104                     <field name="opportunity_id"/>
105                 </group>
106                 <separator string="Description" colspan="4" />
107                 <field name="description" nolabel="1" colspan="4" />
108                 <separator colspan="4" />
109                 <group col="8" colspan="4">
110                     <field name="state" select="1" />
111                     <button name="case_cancel" string="Cancel"
112                         states="draft,open,pending" type="object"
113                         icon="gtk-cancel" />
114                     <button name="case_open" string="Open"
115                         states="draft,pending" type="object"
116                         icon="gtk-go-forward" />
117                     <button name="case_pending" string="Not Held"
118                         states="open" type="object" icon="gtk-media-pause" />
119                     <button name="case_close" string="Held"
120                         states="open,draft,pending" type="object"
121                         icon="gtk-jump-to" />
122                     <button name="case_reset" string="Reset to Draft"
123                         states="done,cancel" type="object"
124                         icon="gtk-convert" />
125                 </group>
126             </form>
127         </field>
128     </record>
129
130     <!--Inbound Phonecalls Form View -->
131
132     <record model="ir.ui.view" id="crm_case_inbound_phone_form_view">
133         <field name="name">CRM - Inbound Phone Call Form</field>
134         <field name="model">crm.phonecall</field>
135         <field name="type">form</field>
136         <field name="arch" type="xml">
137             <form string="Phone Call">
138                 <group colspan="4" col="7">
139                     <field name="name" required="1"/>
140                     <field name="partner_phone"/>
141                     <field name="duration" widget="float_time"/>
142                     <button string="Schedule a Meeting"
143                         name="action_make_meeting"
144                         icon="gtk-redo"
145                         type="object" />
146
147                     <field name="date" required="1"/>
148                     <field name="user_id"/>
149                     <field name="section_id" colspan="1" widget="selection" />
150                     <button string="Convert to Opportunity"
151                         name="%(phonecall2opportunity_act)d"
152                         icon="gtk-index" type="action"
153                         attrs="{'invisible':[('opportunity_id','!=',False)]}" />
154                     <label colspan="6"  string=""/>
155                     <button string="Schedule Other Call"
156                      icon="terp-call-start"
157                     name="%(phonecall_to_phonecall_act)d"
158                     type="action"  />
159
160                 </group>
161                 <group col="3" colspan="2">
162                     <separator colspan="3" string="Contacts" />
163                     <field name="partner_id"
164                         on_change="onchange_partner_id(partner_id, email_from)" />
165                     <button string="Create a Partner"
166                         icon="terp-partner"
167                         name="%(action_crm_phonecall2partner)d"
168                         type="action"
169                         attrs="{'invisible':[('partner_id','!=',False)]}"
170                         groups="base.group_partner_manager" />
171                     <newline/>
172                     <field name="partner_address_id"
173                         on_change="onchange_partner_address_id(partner_address_id, email_from)" />
174                     <newline/>
175                     <field name="partner_mobile" />
176                 </group>
177                 <group col="2" colspan="2">
178                     <separator colspan="2" string="Categorization" />
179                     <field name="categ_id" widget="selection"
180                         domain="[('object_id.model', '=', 'crm.phonecall')]"
181                         string="Type" />
182                     <field name="priority"/>
183                     <field name="opportunity_id"/>
184                 </group>
185                 <separator string="Description" colspan="4" />
186                 <field name="description" nolabel="1" colspan="4" />
187                 <separator colspan="4" />
188             </form>
189         </field>
190     </record>
191
192     <!--Inbound Phonecalls Tree View -->
193
194     <record model="ir.ui.view" id="crm_case_inbound_phone_tree_view">
195         <field name="name">CRM - Inbound Phone Calls Tree</field>
196         <field name="model">crm.phonecall</field>
197         <field name="type">tree</field>
198         <field name="arch" type="xml">
199             <tree string="Phone Calls" colors="grey:state in ('cancel','done');blue:state in ('pending',)" editable="top">
200                 <field name="date"/>
201                 <field name="name"/>
202                 <field name="partner_id"
203                     on_change="onchange_partner_id(partner_id)"
204                     string="Partner" />
205                 <field name="partner_address_id"
206                         on_change="onchange_partner_address_id(partner_address_id)" />
207                 <field name="partner_phone"/>
208                 <field name="user_id"/>
209                 <field name="categ_id" widget="selection"
210                     domain="[('object_id.model', '=', 'crm.phonecall')]"
211                     string="Type" />
212                 <field name="state" invisible="1"/>
213                 <field name="create_date" invisible="1"/>
214                 <button string="Schedule Other Call"
215                     icon="terp-call-start"
216                     name="%(phonecall_to_phonecall_act)d"
217                     type="action"  />
218                 <button string="Convert to Opportunity"
219                     name="%(phonecall2opportunity_act)d"
220                     states="draft,open,pending"
221                     icon="gtk-index"
222                     type="action" attrs="{'invisible':[('opportunity_id','!=',False)]}" />
223                 <button string="Meeting"
224                     states="draft,open,pending" icon="gtk-redo"
225                      name="action_make_meeting" type="object" />
226             </tree>
227         </field>
228     </record>
229
230 <!-- Phonecalls Calendar View -->
231
232     <record model="ir.ui.view" id="crm_case_phone_calendar_view">
233         <field name="name">CRM - Phone Calls Calendar</field>
234         <field name="model">crm.phonecall</field>
235         <field name="type">calendar</field>
236         <field name="priority" eval="2"/>
237         <field name="arch" type="xml">
238             <calendar string="Phone Calls" date_start="date" color="user_id" date_delay="duration">
239                 <field name="name"/>
240                 <field name="partner_id"/>
241             </calendar>
242         </field>
243     </record>
244
245 <!-- Phonecalls Search View  -->
246
247     <record id="view_crm_case_phonecalls_filter" model="ir.ui.view">
248         <field name="name">CRM - Phone Calls Search</field>
249         <field name="model">crm.phonecall</field>
250         <field name="type">search</field>
251         <field name="arch" type="xml">
252             <search string="Search Phonecalls">
253                <filter icon="terp-check" string="Current"
254                    name="current"
255                    domain="[('state','in', ('draft','open','pending'))]"/>
256                <filter icon="terp-go-today" string="Today"
257                    domain="[('date','&lt;', time.strftime('%%Y-%%m-%%d 23:59:59')),
258                     ('date','&gt;=',time.strftime('%%Y-%%m-%%d 00:00:00'))]"
259                    name="today"
260                    help="Todays's Phonecalls"
261                />
262                <filter icon="terp-go-week"
263                    string="7 Days"
264                    help="Phonecalls during last 7 days"
265                    domain="[('date','&gt;=',(datetime.date.today()-datetime.timedelta(days=7)).strftime('%%Y-%%m-%%d'))]"
266                />
267
268                <separator orientation="vertical"/>
269                <field name="name"/>
270                <field name="partner_id"/>
271                <field name="user_id">
272                    <filter icon="terp-personal-"
273                        domain="[('user_id','=',False)]"
274                        help="Unassigned Phonecalls" />
275                </field>
276                <field name="section_id"
277                    select="1" widget="selection" string="Sales Team">
278                    <filter icon="terp-personal+" groups="base.group_extended"
279                        domain="['|', ('section_id', '=', context.get('section_id')), '|', ('section_id.user_id','=',uid), ('section_id.member_ids', 'in', [uid])]"
280                        help="My Sales Team(s)" />
281                </field>
282                <newline/>
283                <group expand="0" string="Group By..." colspan="4">
284                    <filter string="Partner" icon="terp-partner" domain="[]"
285                        context="{'group_by':'partner_id'}" />
286                    <filter string="Responsible" icon="terp-personal"
287                        domain="[]" context="{'group_by':'user_id'}" />
288                    <separator orientation="vertical" />
289                    <filter string="Creation" icon="terp-go-month" help="Creation Date"
290                        domain="[]" context="{'group_by':'create_date'}" />
291                    <filter string="Date" icon="terp-go-month" domain="[]"
292                        context="{'group_by':'date'}" help="Date of Call" />
293                </group>
294            </search>
295         </field>
296     </record>
297
298     </data>
299 </openerp>