[IMP] mail.alias: fix creation errors for inheriting models
[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">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_check_and_set_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">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_check_and_set_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
65     <record model="ir.ui.view" id="crm_case_phone_tree_view">
66         <field name="name">CRM - Phone Calls Tree</field>
67         <field name="model">crm.phonecall</field>
68         <field name="type">tree</field>
69         <field name="arch" type="xml">
70             <tree fonts="bold:needaction_pending==True" colors="gray:state in ('cancel','done');blue:state in ('pending',)" string="Phone Calls">
71                 <field name="needaction_pending" invisible="1"/>
72                 <field name="date"/>
73                 <field name="name"/>
74                 <field name="partner_id"/>
75                 <field name="partner_phone"/>
76                 <field name="user_id"/>
77                 <field name="categ_id" invisible="1"/>
78                 <field name="create_date" invisible="1"/>
79                 <field name="opportunity_id" invisible="1"/>
80                 <field name="needaction_pending" invisible="1"/>
81                 <button string="Convert to Opportunity"
82                     name="%(phonecall2opportunity_act)d"
83                     states="open,pending"
84                     icon="gtk-index"
85                     type="action" attrs="{'invisible':[('opportunity_id','!=',False)]}" />
86                 <button string="Meeting"
87                     states="open,pending" icon="gtk-redo"
88                      name="action_make_meeting" type="object" />
89                 <field name="state"/>
90                 <button name="case_open" string="Confirm" type="object"
91                         states="draft,pending" icon="gtk-go-forward"/>
92                 <button name="case_close" string="Held" type="object"
93                         states="open,pending" icon="gtk-jump-to"/>
94                 <button name="case_cancel" string="Cancel" type="object"
95                         states="draft,open,pending" icon="gtk-cancel"/>
96                 <button name="case_reset" string="Reset to Todo" type="object"
97                         states="cancel" icon="gtk-convert"/>
98             </tree>
99         </field>
100     </record>
101
102 <!-- Phonecalls Form View -->
103
104     <record model="ir.ui.view" id="crm_case_phone_form_view">
105         <field name="name">CRM - Phone Call Form</field>
106         <field name="model">crm.phonecall</field>
107         <field name="type">form</field>
108         <field name="arch" type="xml">
109             <form version="7.0">
110             <header>
111                 <button name="case_close" string="Held" type="object" class="oe_highlight"
112                         states="open,pending"/>
113                 <button name="case_reset" string="Reset to Todo" type="object"
114                         states="cancel"/>
115                 <button string="Convert to Opportunity"
116                         name="%(phonecall2opportunity_act)d"
117                         type="action"
118                         attrs="{'invisible':[ '|', ('opportunity_id','!=',False), ('state','!=', 'open')]}" />
119                 <button string="Convert to Opportunity" class="oe_highlight"
120                         name="%(phonecall2opportunity_act)d"
121                         type="action"
122                         attrs="{'invisible':[ '|', ('opportunity_id','!=',False), ('state','!=', 'done')]}" />
123                 <button string="Schedule Other Call"
124                         name="%(phonecall_to_phonecall_act)d"
125                         type="action"  />
126                 <button string="Schedule a Meeting" name="action_make_meeting" type="object"/>
127                 <button name="case_cancel" string="Cancel" type="object"
128                         states="draft,open,pending"/>
129                 <field name="state" widget="statusbar" nolabel="1" statusbar_visible="open,done"/>
130             </header>
131             <sheet string="Phone Call">
132                   <div class="oe_title">
133                       <div class="oe_edit_only">
134                           <label for="name" string="Title"/> 
135                       </div>
136                       <h1><field name="name" required="1"/></h1>
137                       <div class="oe_edit_only">
138                         <label for="partner_phone" string="Phone" />
139                       </div>
140                       <h2><field name="partner_phone"/></h2>
141                   </div>
142                  <group col="4">
143                     <field name="date" />
144                     <field name="user_id" />
145                     <field name="duration" widget="float_time" />
146                     <field name="section_id" colspan="1" widget="selection" />
147                     <field name="partner_id" on_change="onchange_partner_id(partner_id)"/>
148                     <field name="categ_id" widget="selection"
149                         domain="[('object_id.model', '=', 'crm.phonecall')]"/>
150                     <field name="partner_mobile" />
151                     <field name="priority"/>
152                     <field name="opportunity_id"/>
153                 </group>
154
155                 <field name="description" placeholder="Description..." />
156             </sheet>
157             <div class="oe_chatter">
158                 <field name="message_ids" widget="mail_thread"/>
159             </div>
160             </form>
161         </field>
162     </record>
163
164     <!--Logged Phonecalls Tree View -->
165
166     <record model="ir.ui.view" id="crm_case_inbound_phone_tree_view">
167         <field name="name">CRM - Logged Phone Calls Tree</field>
168         <field name="model">crm.phonecall</field>
169         <field name="type">tree</field>
170         <field name="arch" type="xml">
171             <tree string="Phone Calls" fonts="bold:needaction_pending==True" editable="top">
172                 <field name="date"/>
173                 <field name="name"/>
174                 <field name="partner_id"
175                     on_change="onchange_partner_id(partner_id)"/>
176                 <field name="partner_phone"
177                     invisible="1"/>
178                 <field name="user_id"/>
179                 <field name="categ_id" widget="selection"
180                     domain="[('object_id.model', '=', 'crm.phonecall')]"
181                     invisible="1"/>
182                 <field name="state" invisible="1"/>
183                 <field name="create_date" invisible="1"/>
184                 <field name="opportunity_id" invisible="1"/>
185                 <field name="needaction_pending" invisible="1"/>
186                 <button string="Schedule Other Call"
187                     icon="terp-call-start"
188                     name="%(phonecall_to_phonecall_act)d"
189                     type="action"  />
190                 <button string="Meeting"
191                      icon="gtk-redo"
192                      name="action_make_meeting" type="object" />
193                 <button string="Convert to Opportunity"
194                     name="%(phonecall2opportunity_act)d"
195                     states="open,pending"
196                     icon="gtk-index"
197                     type="action" attrs="{'invisible':[('opportunity_id','!=',False)]}" />
198             </tree>
199         </field>
200     </record>
201
202     <!-- Phonecalls Calendar View -->
203
204     <record model="ir.ui.view" id="crm_case_phone_calendar_view">
205         <field name="name">CRM - Phone Calls Calendar</field>
206         <field name="model">crm.phonecall</field>
207         <field name="type">calendar</field>
208         <field name="priority" eval="2"/>
209         <field name="arch" type="xml">
210             <calendar string="Phone Calls" date_start="date" color="user_id" date_delay="duration">
211                 <field name="name"/>
212                 <field name="partner_id"/>
213             </calendar>
214         </field>
215     </record>
216
217     <!-- Phonecalls Search View  -->
218     <record id="view_crm_case_phonecalls_filter" model="ir.ui.view">
219         <field name="name">CRM - Phone Calls Search</field>
220         <field name="model">crm.phonecall</field>
221         <field name="type">search</field>
222         <field name="arch" type="xml">
223             <search string="Search Phonecalls">
224                <field name="name" string="Phonecalls"/>
225                <field name="date"/>
226                <filter icon="terp-mail-message-new" string="Inbox" help="Unread messages" name="needaction_pending" domain="[('needaction_pending','=',True)]"/>
227                <separator/>
228                <filter icon="terp-gtk-go-back-rtl" string="To Do" name="current" domain="[('state','=','open')]"/>
229                <separator/>
230                <filter string="Unassigned Phonecalls" icon="terp-personal-" domain="[('user_id','=',False)]" help="Unassigned Phonecalls"/>
231                <separator/>
232                <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])]"
233                        help="Phone Calls that are assigned to me or to my team(s)" />
234                <field name="partner_id"/>
235                <field name="user_id"/>
236                <field name="section_id" string="Sales Team"/>
237                <group expand="0" string="Group By...">
238                    <filter string="Partner" icon="terp-partner" domain="[]" context="{'group_by':'partner_id'}" />
239                    <filter string="Responsible" icon="terp-personal" domain="[]" context="{'group_by':'user_id'}" />
240                    <filter string="Creation" icon="terp-go-month" help="Creation Date" domain="[]" context="{'group_by':'create_date'}" />
241                    <filter string="Date" icon="terp-go-month" domain="[]" context="{'group_by':'date'}" help="Date of Call" />
242                </group>
243            </search>
244         </field>
245     </record>
246
247     </data>
248 </openerp>