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