[IMP] crm: updated crm_meeting and crm_phonecall, to have Inbox filter for needaction.
[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" eval="{'object_id': ref('model_crm_phonecall')}"/>
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" groups="base.group_no_one"/>
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 fonts="bold:needaction_pending==True" colors="gray:state in ('cancel','done');blue:state in ('pending',)" string="Phone Calls">
28                 <field name="needaction_pending" invisible="1"/>
29                 <field name="date"/>
30                 <field name="name"/>
31                 <field name="partner_id"/>
32                 <field name="partner_phone"/>
33                 <field name="user_id"/>
34                 <field name="categ_id" invisible="1"/>
35                 <field name="create_date" invisible="1"/>
36                 <field name="opportunity_id" invisible="1"/>
37                 <button string="Convert to Opportunity"
38                     name="%(phonecall2opportunity_act)d"
39                     states="open,pending"
40                     icon="gtk-index"
41                     type="action" attrs="{'invisible':[('opportunity_id','!=',False)]}" />
42                 <button string="Meeting"
43                     states="open,pending" icon="gtk-redo"
44                      name="action_make_meeting" type="object" />
45                 <field name="state"/>
46                 <button name="case_open" string="Confirm" type="object"
47                         states="draft,pending" icon="gtk-go-forward"/>
48                 <button name="case_close" string="Held" type="object"
49                         states="open,pending" icon="gtk-jump-to"/>
50                 <button name="case_cancel" string="Cancel" type="object"
51                         states="draft,open,pending" icon="gtk-cancel"/>
52                 <button name="case_reset" string="Reset to Todo" type="object"
53                         states="cancel" icon="gtk-convert"/>
54             </tree>
55         </field>
56     </record>
57
58 <!-- Phonecalls Form View -->
59
60     <record model="ir.ui.view" id="crm_case_phone_form_view">
61         <field name="name">CRM - Phone Call Form</field>
62         <field name="model">crm.phonecall</field>
63         <field name="type">form</field>
64         <field name="arch" type="xml">
65             <form version="7.0">
66             <header>
67                 <button name="case_open" string="Confirm" type="object"
68                         states="draft,pending"/>
69                 <button name="case_close" string="Held" type="object"
70                         states="open,pending"/>
71                 <button name="case_reset" string="Reset to Todo" type="object"
72                         states="cancel"/>
73                 <button name="case_cancel" string="Cancel" type="object"
74                         states="draft,open,pending"/>
75                 <button string="Convert to Opportunity"
76                     name="%(phonecall2opportunity_act)d"
77                     type="action"
78                     attrs="{'invisible':[('opportunity_id','!=',False)]}" />
79                 <button string="Schedule Other Call"
80                     name="%(phonecall_to_phonecall_act)d"
81                     type="action"  />
82                 <button string="Schedule a Meeting" name="action_make_meeting" type="object"/>
83                 <field name="state" widget="statusbar" nolabel="1" statusbar_visible="draft,open,done"/>
84             </header>
85             <sheet string="Phone Call">
86                   <div class="oe_title">
87                       <div class="oe_edit_only">
88                           <label for="name" string="Title"/> 
89                       </div>
90                       <h1><field name="name" required="1"/></h1>
91                       <div class="oe_edit_only">
92                         <label for="partner_phone" string="Phone" />
93                       </div>
94                       <h2><field name="partner_phone"/></h2>
95                   </div>
96                  <group col="4">
97                     <field name="date" />
98                     <field name="user_id" />
99                     <field name="duration" widget="float_time" />
100                     <field name="section_id" colspan="1" widget="selection" />
101                     <field name="partner_id" on_change="onchange_partner_id(partner_id)" />
102                     <field name="categ_id" widget="selection"
103                         domain="[('object_id.model', '=', 'crm.phonecall')]"/>
104                     <field name="partner_mobile" />
105                     <field name="priority"/>
106                     <field name="opportunity_id"/>
107                 </group>
108
109                 <field name="description" placeholder="Description..." />
110             </sheet>
111             <footer>
112                 <field name="message_ids" widget="ThreadView"/>
113             </footer>
114             </form>
115         </field>
116     </record>
117
118     <!--Logged Phonecalls Tree View -->
119
120     <record model="ir.ui.view" id="crm_case_inbound_phone_tree_view">
121         <field name="name">CRM - Logged Phone Calls Tree</field>
122         <field name="model">crm.phonecall</field>
123         <field name="type">tree</field>
124         <field name="arch" type="xml">
125             <tree string="Phone Calls" fonts="bold:needaction_pending==True" editable="top">
126                 <field name="needaction_pending" invisible="1"/>
127                 <field name="date"/>
128                 <field name="name"/>
129                 <field name="partner_id"
130                     on_change="onchange_partner_id(partner_id)"
131                     string="Partner" />
132                 <field name="partner_phone"
133                     invisible="1"/>
134                 <field name="user_id"/>
135                 <field name="categ_id" widget="selection"
136                     domain="[('object_id.model', '=', 'crm.phonecall')]"
137                     invisible="1"/>
138                 <field name="state" invisible="1"/>
139                 <field name="create_date" invisible="1"/>
140                 <field name="opportunity_id" invisible="1"/>
141                 <button string="Schedule Other Call"
142                     icon="terp-call-start"
143                     name="%(phonecall_to_phonecall_act)d"
144                     type="action"  />
145                 <button string="Meeting"
146                      icon="gtk-redo"
147                      name="action_make_meeting" type="object" />
148                 <button string="Convert to Opportunity"
149                     name="%(phonecall2opportunity_act)d"
150                     states="open,pending"
151                     icon="gtk-index"
152                     type="action" attrs="{'invisible':[('opportunity_id','!=',False)]}" />
153             </tree>
154         </field>
155     </record>
156
157     <!-- Phonecalls Calendar View -->
158
159     <record model="ir.ui.view" id="crm_case_phone_calendar_view">
160         <field name="name">CRM - Phone Calls Calendar</field>
161         <field name="model">crm.phonecall</field>
162         <field name="type">calendar</field>
163         <field name="priority" eval="2"/>
164         <field name="arch" type="xml">
165             <calendar string="Phone Calls" date_start="date" color="user_id" date_delay="duration">
166                 <field name="name"/>
167                 <field name="partner_id"/>
168             </calendar>
169         </field>
170     </record>
171
172     <!-- Phonecalls Search View  -->
173     <record id="view_crm_case_phonecalls_filter" model="ir.ui.view">
174         <field name="name">CRM - Phone Calls Search</field>
175         <field name="model">crm.phonecall</field>
176         <field name="type">search</field>
177         <field name="arch" type="xml">
178             <search string="Search Phonecalls">
179                 <filter icon="terp-mail-message-new"
180                     string="Inbox" help="Unread messages"
181                     name="needaction_pending"
182                     domain="[('needaction_pending','=',True)]"/>
183                 <separator orientation="vertical"/>
184                 <filter icon="terp-go-today" string="Today"
185                     domain="[('date','&lt;', time.strftime('%%Y-%%m-%%d 23:59:59')),
186                         ('date','&gt;=',time.strftime('%%Y-%%m-%%d 00:00:00'))]"
187                     name="today"
188                     help="Todays's Phonecalls"
189                 />
190                 <filter icon="terp-go-week"
191                     string="7 Days"
192                     help="Phonecalls during last 7 days"
193                     domain="[('date','&gt;=',(datetime.date.today()-datetime.timedelta(days=7)).strftime('%%Y-%%m-%%d'))]"
194                 />
195                 <separator orientation="vertical"/>
196                 <field name="name"/>
197                 <field name="partner_id"/>
198                 <field name="user_id">
199                     <filter icon="terp-personal-"
200                         domain="[('user_id','=',False)]"
201                         help="Unassigned Phonecalls" />
202                 </field>
203                 <field name="section_id"
204                     widget="selection" string="Sales Team">
205                     <filter icon="terp-personal+"
206                         domain="['|', ('section_id.user_id','=',uid), ('section_id.member_ids', 'in', [uid])]"
207                         help="My Sales Team(s)" />
208                 </field>
209                 <newline/>
210                 <group expand="0" string="Group By...">
211                     <filter string="Partner" icon="terp-partner" domain="[]"
212                         context="{'group_by':'partner_id'}" />
213                     <filter string="Responsible" icon="terp-personal"
214                         domain="[]" context="{'group_by':'user_id'}" />
215                     <separator orientation="vertical" />
216                     <filter string="Creation" icon="terp-go-month" help="Creation Date"
217                         domain="[]" context="{'group_by':'create_date'}" />
218                     <filter string="Date" icon="terp-go-month" domain="[]"
219                         context="{'group_by':'date'}" help="Date of Call" />
220                 </group>
221             </search>
222         </field>
223     </record>
224
225     <!-- Scheduled a phonecall search view-->
226     <record id="view_crm_case_scheduled_phonecalls_filter" model="ir.ui.view">
227         <field name="name">CRM - Scheduled Calls Search</field>
228         <field name="model">crm.phonecall</field>
229         <field name="type">search</field>
230         <field name="arch" type="xml">
231             <search string="Scheduled Phonecalls">
232                 <filter icon="terp-mail-message-new"
233                     string="Inbox" help="Unread messages"
234                     name="needaction_pending"
235                     domain="[('needaction_pending','=',True)]"/>
236                 <separator orientation="vertical"/>
237                 <filter icon="terp-gtk-go-back-rtl" string="To Do" name="current" domain="[('state','=','open')]"/>
238                 <separator orientation="vertical"/>
239                 <filter icon="terp-go-today" string="Today"
240                     domain="[('date','&lt;', time.strftime('%%Y-%%m-%%d 23:59:59')),
241                         ('date','&gt;=',time.strftime('%%Y-%%m-%%d 00:00:00'))]"
242                     name="today"
243                     help="Todays's Phonecalls"
244                 />
245                 <filter icon="terp-go-week"
246                     string="7 Days"
247                     help="Phonecalls during last 7 days"
248                     domain="[('date','&gt;=',(datetime.date.today()-datetime.timedelta(days=7)).strftime('%%Y-%%m-%%d'))]"
249                 />
250                 <separator orientation="vertical"/>
251                 <field name="name"/>
252                 <field name="partner_id"/>
253                 <field name="user_id">
254                     <filter icon="terp-personal-"
255                         domain="[('user_id','=',False)]"
256                         help="Unassigned Phonecalls" />
257                 </field>
258                 <field name="section_id"
259                     widget="selection" string="Sales Team">
260                     <filter icon="terp-personal+"
261                         domain="['|', ('section_id.user_id','=',uid), ('section_id.member_ids', 'in', [uid])]"
262                         help="My Sales Team(s)" />
263                 </field>
264                 <newline/>
265                 <group expand="0" string="Group By...">
266                     <filter string="Partner" icon="terp-partner" domain="[]"
267                         context="{'group_by':'partner_id'}" />
268                     <filter string="Responsible" icon="terp-personal"
269                         domain="[]" context="{'group_by':'user_id'}" />
270                     <separator orientation="vertical" />
271                     <filter string="Creation" icon="terp-go-month" help="Creation Date"
272                         domain="[]" context="{'group_by':'create_date'}" />
273                     <filter string="Date" icon="terp-go-month" domain="[]"
274                         context="{'group_by':'date'}" help="Date of Call" />
275                 </group>
276             </search>
277         </field>
278     </record>
279
280     </data>
281 </openerp>