[FIX] forgot a %
[odoo/odoo.git] / addons / crm / crm_phonecall_view.xml
1 <?xml version="1.0"?>
2 <openerp>
3     <data>
4
5     <!-- Read/Unread actions -->
6     <record id="actions_server_crm_phonecall_unread" model="ir.actions.server">
7         <field name="name">CRM Phonecall: Mark unread</field>
8         <field name="condition">True</field>
9         <field name="type">ir.actions.server</field>
10         <field name="model_id" ref="model_crm_phonecall"/>
11         <field name="state">code</field>
12         <field name="code">self.message_mark_as_unread(cr, uid, context.get('active_ids'), context=context)</field>
13     </record>
14     <record id="action_crm_phonecall_unread" model="ir.values">
15         <field name="name">action_crm_phonecall_unread</field>
16         <field name="action_id" ref="actions_server_crm_phonecall_unread"/>
17         <field name="value" eval="'ir.actions.server,' + str(ref('actions_server_crm_phonecall_unread'))"/>
18         <field name="key">action</field>
19         <field name="model_id" ref="model_crm_phonecall"/>
20         <field name="model">crm.phonecall</field>
21         <field name="key2">client_action_multi</field>
22     </record>
23
24     <record id="actions_server_crm_phonecall_read" model="ir.actions.server">
25         <field name="name">CRM Phonecall: Mark read</field>
26         <field name="condition">True</field>
27         <field name="type">ir.actions.server</field>
28         <field name="model_id" ref="model_crm_phonecall"/>
29         <field name="state">code</field>
30         <field name="code">self.message_mark_as_read(cr, uid, context.get('active_ids'), context=context)</field>
31     </record>
32     <record id="action_crm_phonecall_read" model="ir.values">
33         <field name="name">action_crm_phonecall_read</field>
34         <field name="action_id" ref="actions_server_crm_phonecall_read"/>
35         <field name="value" eval="'ir.actions.server,' + str(ref('actions_server_crm_phonecall_read'))"/>
36         <field name="key">action</field>
37         <field name="model_id" ref="model_crm_phonecall"/>
38         <field name="model">crm.phonecall</field>
39         <field name="key2">client_action_multi</field>
40     </record>
41
42     <!--  Phonecall Categories Form View  -->
43     <record id="crm_phonecall_categ_action" model="ir.actions.act_window">
44         <field name="name">Phonecall Categories</field>
45         <field name="res_model">crm.case.categ</field>
46         <field name="view_type">form</field>
47         <field name="view_id" ref="crm.crm_case_categ_tree-view"/>
48         <field name="domain">[('object_id.model', '=', 'crm.phonecall')]</field>
49         <field name="context" eval="{'object_id': ref('model_crm_phonecall')}"/>
50         <field name="help" type="html">
51           <p class="oe_view_nocontent_create">
52             Click to add a new category.
53           </p><p>
54             Create specific phone call categories to better define the type of
55             calls tracked in the system.
56           </p>
57         </field>
58     </record>
59
60     <menuitem action="crm_phonecall_categ_action" name="Categories"
61         id="menu_crm_case_phonecall-act" parent="menu_crm_config_phonecall" groups="base.group_no_one"/>
62
63     <!--  Phonecalls Tree View -->
64     <record model="ir.ui.view" id="crm_case_phone_tree_view">
65         <field name="name">CRM - Phone Calls Tree</field>
66         <field name="model">crm.phonecall</field>
67         <field name="arch" type="xml">
68             <tree colors="gray:state in ('cancel','done');blue:state in ('pending',)" string="Phone Calls">
69                 <field name="date"/>
70                 <field name="name"/>
71                 <field name="partner_id"/>
72                 <button string="Meeting"
73                     states="open,pending" icon="gtk-redo"
74                      name="action_make_meeting" type="object"/>
75                 <button string="Convert to Opportunity"
76                     name="action_button_convert2opportunity"
77                     states="open,pending"
78                     icon="gtk-index"
79                     type="object" attrs="{'invisible':[('opportunity_id','!=',False)]}"/>
80                 <field name="partner_phone"/>
81                 <field name="user_id"/>
82                 <field name="categ_id" invisible="1"/>
83                 <field name="create_date" invisible="1"/>
84                 <field name="opportunity_id" invisible="1"/>
85                 <field name="state"/>
86                 <button name="case_open" string="Confirm" type="object"
87                         states="draft,pending" icon="gtk-go-forward"/>
88                 <button name="case_close" string="Held" type="object"
89                         states="open,pending" icon="gtk-jump-to"/>
90                 <button name="case_cancel" string="Cancel" type="object"
91                         states="draft,open,pending" icon="gtk-cancel"/>
92                 <button name="case_reset" string="Reset to Todo" type="object"
93                         states="cancel" icon="gtk-convert"/>
94             </tree>
95         </field>
96     </record>
97
98     <!-- Phonecalls Form View -->
99     <record model="ir.ui.view" id="crm_case_phone_form_view">
100         <field name="name">CRM - Phone Call Form</field>
101         <field name="model">crm.phonecall</field>
102         <field name="arch" type="xml">
103             <form string="Phone Call" version="7.0">
104                 <header>
105                     <button name="case_close" string="Call Done" type="object" class="oe_highlight"
106                             states="open,pending"/>
107                     <button name="case_reset" string="Reset to Todo" type="object"
108                             states="cancel"/>
109                     <button name="case_cancel" string="Cancel" type="object"
110                             states="draft,open,pending"/>
111                     <field name="state" widget="statusbar" nolabel="1" statusbar_visible="open,done"/>
112                 </header>
113                 <sheet string="Phone Call">
114                     <div class="oe_right">
115                         <button string="Convert to Opportunity"
116                             name="action_button_convert2opportunity"
117                             type="action"
118                             attrs="{'invisible':[ '|', ('opportunity_id','!=',False), ('state', 'not in', ('open', 'done'))]}"/>
119                         <button string="Schedule Other Call"
120                                 name="%(phonecall_to_phonecall_act)d"
121                                 type="action"/>
122                         <button string="Schedule a Meeting" name="action_make_meeting" type="object"/>
123                     </div>
124                     <div class="oe_title">
125                         <div class="oe_edit_only">
126                             <label for="name"/>
127                         </div>
128                         <h1><field name="name" required="1"/></h1>
129                         <div class="oe_edit_only">
130                             <label for="partner_phone" string="Phone"/>
131                         </div>
132                         <h2><field name="partner_phone"/></h2>
133                     </div>
134
135                     <group col="4">
136                         <field name="date"/>
137                         <field name="user_id"/>
138                         <field name="duration" widget="float_time"/>
139                         <field name="section_id" colspan="1" widget="selection"/>
140                         <field name="partner_id" on_change="onchange_partner_id(partner_id)"/>
141                         <field name="email_from" invisible="1"/> <!--not needed because of the chatter, thus invisible, but must be in the view as it's returned by onchange_partner_id()-->
142                         <field name="categ_id" widget="selection"
143                             domain="[('object_id.model', '=', 'crm.phonecall')]"/>
144                         <field name="partner_mobile"/>
145                         <field name="priority"/>
146                         <field name="opportunity_id"/>
147                     </group>
148                     <field name="description" placeholder="Description..."/>
149                 </sheet>
150                 <div class="oe_chatter">
151                     <field name="message_follower_ids" widget="mail_followers"/>
152                     <field name="message_ids" widget="mail_thread"/>
153                 </div>
154             </form>
155         </field>
156     </record>
157
158     <!--Logged Phonecalls Tree View -->
159     <record model="ir.ui.view" id="crm_case_inbound_phone_tree_view">
160         <field name="name">CRM - Logged Phone Calls Tree</field>
161         <field name="model">crm.phonecall</field>
162         <field name="arch" type="xml">
163             <tree string="Phone Calls" editable="top">
164                 <field name="date"/>
165                 <field name="name"/>
166                 <field name="partner_id"
167                     on_change="onchange_partner_id(partner_id)"/>
168                 <field name="partner_phone"
169                     invisible="1"/>
170                 <field name="user_id"/>
171                 <field name="categ_id" widget="selection"
172                     domain="[('object_id.model', '=', 'crm.phonecall')]"
173                     invisible="1"/>
174                 <field name="state" invisible="1"/>
175                 <field name="create_date" invisible="1"/>
176                 <field name="opportunity_id" invisible="1"/>
177                 <button string="Schedule Other Call"
178                     icon="terp-call-start"
179                     name="%(phonecall_to_phonecall_act)d"
180                     type="action"/>
181                 <button string="Meeting"
182                      icon="gtk-redo"
183                      name="action_make_meeting" type="object"/>
184                 <button string="Convert to Opportunity"
185                     name="action_button_convert2opportunity"
186                     states="open,pending"
187                     icon="gtk-index"
188                     type="action" attrs="{'invisible':[('opportunity_id','!=',False)]}"/>
189             </tree>
190         </field>
191     </record>
192
193     <!-- Phonecalls Calendar View -->
194     <record model="ir.ui.view" id="crm_case_phone_calendar_view">
195         <field name="name">CRM - Phone Calls Calendar</field>
196         <field name="model">crm.phonecall</field>
197         <field name="priority" eval="2"/>
198         <field name="arch" type="xml">
199             <calendar string="Phone Calls" date_start="date" color="user_id" date_delay="duration">
200                 <field name="name"/>
201                 <field name="partner_id"/>
202             </calendar>
203         </field>
204     </record>
205
206     <!-- Phonecalls Search View  -->
207     <record id="view_crm_case_phonecalls_filter" model="ir.ui.view">
208         <field name="name">CRM - Phone Calls Search</field>
209         <field name="model">crm.phonecall</field>
210         <field name="arch" type="xml">
211             <search string="Search Phonecalls">
212                <field name="name" string="Phonecalls"/>
213                <field name="date"/>
214                <separator/>
215                <filter icon="terp-gtk-go-back-rtl" string="To Do" name="current" domain="[('state','=','open')]"/>
216                <separator/>
217                <filter string="Unassigned Phonecalls" icon="terp-personal-" domain="[('user_id','=',False)]" help="Unassigned Phonecalls"/>
218                <separator/>
219                <filter string="Phone Calls Assigned to Me or My Team(s)" icon="terp-personal+" domain="['|', ('section_id.user_id','=',uid), ('section_id.member_ids', 'in', [uid])]"
220                        help="Phone Calls that are assigned to me or to my team(s)"/>
221                <field name="partner_id"/>
222                <field name="user_id"/>
223                <field name="section_id" string="Sales Team"/>
224                <group expand="0" string="Group By...">
225                    <filter string="Partner" icon="terp-partner" domain="[]" context="{'group_by':'partner_id'}"/>
226                    <filter string="Responsible" icon="terp-personal" domain="[]" context="{'group_by':'user_id'}"/>
227                    <filter string="Creation" icon="terp-go-month" help="Creation Date" domain="[]" context="{'group_by':'create_date'}"/>
228                    <filter string="Date" icon="terp-go-month" domain="[]" context="{'group_by':'date'}" help="Date of Call"/>
229                </group>
230            </search>
231         </field>
232     </record>
233
234     </data>
235 </openerp>