From 740012537706a67d6aba8f15a455c6b488db45a6 Mon Sep 17 00:00:00 2001 From: "Ujjvala Collins (OpenERP)" Date: Thu, 14 Apr 2011 17:27:33 +0530 Subject: [PATCH 01/11] [IMP]: Improved phonecall views. It'll work according to states rather than type (inbound/outbound). bzr revid: uco@tinyerp.com-20110414115733-ushwf53kxnsl29xc --- addons/crm/crm_phonecall.py | 11 +++-- addons/crm/crm_phonecall_demo.xml | 3 ++ addons/crm/crm_phonecall_menu.xml | 24 +++++------ addons/crm/crm_phonecall_view.xml | 70 ++----------------------------- 4 files changed, 27 insertions(+), 81 deletions(-) diff --git a/addons/crm/crm_phonecall.py b/addons/crm/crm_phonecall.py index 1ee36cefab2..c4e1276a4d1 100644 --- a/addons/crm/crm_phonecall.py +++ b/addons/crm/crm_phonecall.py @@ -53,8 +53,8 @@ class crm_phonecall(crm_case, osv.osv): ('draft', 'Draft'), ('open', 'Todo'), ('cancel', 'Cancelled'), - ('done', 'Done'), - ('pending', 'Pending'), + ('done', 'Held'), + ('pending', 'Not Held'), ], 'State', size=16, readonly=True, help='The state is set to \'Draft\', when a case is created.\ \nIf the case is in progress the state is set to \'Open\'.\ @@ -83,10 +83,15 @@ class crm_phonecall(crm_case, osv.osv): 'message_ids': fields.one2many('mailgate.message', 'res_id', 'Messages', domain=[('model','=',_name)]), } + def _get_default_state(self, cr, uid, context=None): + if context and context.get('default_state', False): + return context.get('default_state') + return 'open' + _defaults = { 'date': lambda *a: time.strftime('%Y-%m-%d %H:%M:%S'), 'priority': crm.AVAILABLE_PRIORITIES[2][0], - 'state': 'open', + 'state': _get_default_state, 'user_id': lambda self,cr,uid,ctx: uid, 'active': 1, } diff --git a/addons/crm/crm_phonecall_demo.xml b/addons/crm/crm_phonecall_demo.xml index 683cbd9735f..8f0661ab8be 100644 --- a/addons/crm/crm_phonecall_demo.xml +++ b/addons/crm/crm_phonecall_demo.xml @@ -18,6 +18,7 @@ + @@ -33,6 +34,7 @@ + @@ -49,6 +51,7 @@ + diff --git a/addons/crm/crm_phonecall_menu.xml b/addons/crm/crm_phonecall_menu.xml index 41975d9ced4..c6d06d1f49d 100644 --- a/addons/crm/crm_phonecall_menu.xml +++ b/addons/crm/crm_phonecall_menu.xml @@ -61,15 +61,15 @@ parent="base.menu_base_partner" sequence="4" /> - Inbound + Log a call crm.phonecall form tree,calendar - - - + + [('state','=','done')] + - The Inbound Calls tool allows you to log your inbound calls on the fly. Each call you get will appear on the partner form to trace every contact you have with a partner. From the phone call form, you can trigger a request for another call, a meeting or an opportunity. + This tool allows you to log your inbound calls on the fly. Each call you get will appear on the partner form to trace every contact you have with a partner. From the phone call form, you can trigger a request for another call, a meeting or an opportunity. @@ -90,24 +90,24 @@ form - + - - Outbound + Schedule a call crm.phonecall form tree,calendar - - + [('state','=','open')] + - Outbound Calls list all the calls to be done by your sales team. A salesman can record the information about the call in the form view. This information will be stored in the partner form to trace every contact you have with a customer. You can also import a .CSV file with a list of calls to be done by your sales team. + Schedule a call lists all the calls to be done by your sales team. A salesman can record the information about the call in the form view. This information will be stored in the partner form to trace every contact you have with a customer. You can also import a .CSV file with a list of calls to be done by your sales team. @@ -131,7 +131,7 @@ - diff --git a/addons/crm/crm_phonecall_view.xml b/addons/crm/crm_phonecall_view.xml index 44487e2aef5..ee88cec0129 100644 --- a/addons/crm/crm_phonecall_view.xml +++ b/addons/crm/crm_phonecall_view.xml @@ -43,7 +43,7 @@ name="action_make_meeting" type="object" />