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