[IMP] crm: Phone calls, usability improvements.

bzr revid: uco@tinyerp.com-20110427092202-2zhwtcyyyccbipk2
This commit is contained in:
Ujjvala Collins (OpenERP) 2011-04-27 14:52:02 +05:30
parent e0c7efa201
commit 92c356a2b9
6 changed files with 16 additions and 12 deletions

View File

@ -4,7 +4,7 @@
<act_window
id="crm_case_categ_phone_create_partner"
name="Schedule Phone Call"
name="Schedule a Call"
res_model="crm.phonecall"
src_model="res.partner"
view_mode="calendar,tree,form"
@ -61,7 +61,7 @@
parent="base.menu_base_partner" sequence="4" />
<record model="ir.actions.act_window" id="crm_case_categ_phone_incoming0">
<field name="name">Log a call</field>
<field name="name">Logged Calls</field>
<field name="res_model">crm.phonecall</field>
<field name="view_type">form</field>
<field name="view_mode">tree,calendar</field>
@ -94,12 +94,12 @@
<field name="act_window_id" ref="crm_case_categ_phone_incoming0"/>
</record>
<menuitem name="Log a call" id="menu_crm_case_phone_inbound"
<menuitem name="Logged Calls" id="menu_crm_case_phone_inbound"
parent="crm.menu_crm_case_phone"
action="crm_case_categ_phone_incoming0" />
<record model="ir.actions.act_window" id="crm_case_categ_phone_outgoing0">
<field name="name">Schedule a call</field>
<field name="name">Scheduled Calls</field>
<field name="res_model">crm.phonecall</field>
<field name="view_type">form</field>
<field name="view_mode">tree,calendar</field>
@ -131,7 +131,7 @@
<field name="act_window_id" ref="crm_case_categ_phone_outgoing0"/>
</record>
<menuitem name="Schedule a call" id="menu_crm_case_phone_outbound"
<menuitem name="Scheduled Calls" id="menu_crm_case_phone_outbound"
parent="crm.menu_crm_case_phone"
action="crm_case_categ_phone_outgoing0" />

View File

@ -64,7 +64,7 @@
<field name="duration" widget="float_time"/>
<button string="Schedule a Meeting" name="action_make_meeting" icon="gtk-redo" type="object"/>
<field name="date" required="1"/>
<field name="date"/>
<field name="user_id"/>
<field name="section_id" colspan="1" widget="selection" />
<button string="Convert to Opportunity"

View File

@ -22,6 +22,8 @@
from osv import osv, fields
from tools.translate import _
import time
class crm_opportunity2phonecall(osv.osv_memory):
"""Converts Opportunity to Phonecall"""
@ -31,7 +33,7 @@ class crm_opportunity2phonecall(osv.osv_memory):
_columns = {
'name' : fields.char('Call summary', size=64, required=True, select=1),
'user_id' : fields.many2one('res.users', "Assign To"),
'date': fields.datetime('Date' , required=True),
'date': fields.datetime('Date'),
'section_id': fields.many2one('crm.case.section', 'Sales Team'),
'categ_id': fields.many2one('crm.case.categ', 'Category', \
domain="['|',('section_id','=',False),('section_id','=',section_id),\
@ -59,7 +61,7 @@ class crm_opportunity2phonecall(osv.osv_memory):
record_ids = context and context.get('active_ids', []) or []
res = super(crm_opportunity2phonecall, self).default_get(cr, uid, fields, context=context)
res.update({'action': 'schedule'})
res.update({'action': 'schedule', 'date': time.strftime('%Y-%m-%d %H:%M:%S')})
for opp in opp_obj.browse(cr, uid, record_ids, context=context):
if 'name' in fields:
res.update({'name': opp.name})

View File

@ -14,7 +14,7 @@
<field name="action"/>
<separator string="Call Details" colspan="4"/>
<field name="name"/>
<field name="date" string="Planned Date"/>
<field name="date" string="Planned Date" attrs="{'invisible': [('action','=','log')]}"/>
<newline/>
<field name="user_id" />
<field name="section_id" widget="selection" />

View File

@ -22,6 +22,8 @@
from osv import osv, fields
from tools.translate import _
import time
class crm_phonecall2phonecall(osv.osv_memory):
""" Converts Phonecall to Phonecall"""
@ -109,7 +111,7 @@ class crm_phonecall2phonecall(osv.osv_memory):
'categ_id': fields.many2one('crm.case.categ', 'Category', \
domain="['|',('section_id','=',False),('section_id','=',section_id),\
('object_id.model', '=', 'crm.phonecall')]"),
'date': fields.datetime('Date', required=True),
'date': fields.datetime('Date'),
'section_id':fields.many2one('crm.case.section','Sales Team'),
'action': fields.selection([('schedule','Schedule a call'), ('log','Log a call')], 'Action', required=True),
}
@ -127,7 +129,7 @@ class crm_phonecall2phonecall(osv.osv_memory):
"""
res = super(crm_phonecall2phonecall, self).default_get(cr, uid, fields, context=context)
record_id = context and context.get('active_id', False) or False
res.update({'action': 'schedule'})
res.update({'action': 'schedule', 'date': time.strftime('%Y-%m-%d %H:%M:%S')})
if record_id:
phonecall = self.pool.get('crm.phonecall').browse(cr, uid, record_id, context=context)

View File

@ -14,7 +14,7 @@
<field name="action"/>
<separator string="Call Details" colspan="4"/>
<field name="name"/>
<field name="date" string="Planned Date"/>
<field name="date" string="Planned Date" attrs="{'invisible': [('action','=','log')]}"/>
<field name="user_id" />
<field name="section_id"/>
<field name="categ_id" widget="selection" domain="[('object_id.model', '=', 'crm.phonecall')]"/>