diff --git a/addons/crm/crm.py b/addons/crm/crm.py index d7b67879a7a..fd9b7780cec 100644 --- a/addons/crm/crm.py +++ b/addons/crm/crm.py @@ -331,8 +331,6 @@ class crm_case(object): if not case.user_id: data['user_id'] = uid self.write(cr, uid, case.id, data) - - self._action(cr, uid, cases, 'open') return True @@ -423,11 +421,14 @@ class crm_case(object): @param ids: List of case Ids @param *args: Tuple Value for additional Params """ + state = 'draft' + if 'crm.phonecall' in args: + state = 'open' cases = self.browse(cr, uid, ids) cases[0].state # to fill the browse record cache self._history(cr, uid, cases, _('Draft')) - self.write(cr, uid, ids, {'state': 'draft', 'active': True}) - self._action(cr, uid, cases, 'draft') + self.write(cr, uid, ids, {'state': state, 'active': True}) + self._action(cr, uid, cases, state) return True def remind_partner(self, cr, uid, ids, context=None, attach=False): @@ -454,9 +455,9 @@ class crm_case(object): """ for case in self.browse(cr, uid, ids, context=context): if not destination and not case.email_from: - raise osv.except_osv(_('Error!'), ("Partner Email is not specified in Case")) + return False if not case.user_id.user_email: - raise osv.except_osv(_('Error!'), ("User Email is not specified in Case")) + return False if destination and case.section_id.user_id: case_email = case.section_id.user_id.user_email diff --git a/addons/crm/crm_lead.py b/addons/crm/crm_lead.py index 864e4dfc0a4..090664570e5 100644 --- a/addons/crm/crm_lead.py +++ b/addons/crm/crm_lead.py @@ -143,7 +143,7 @@ class crm_lead(crm_case, osv.osv): domain="['|',('section_id','=',section_id),('section_id','=',False), ('object_id.model', '=', 'crm.lead')]"), 'type_id': fields.many2one('crm.case.resource.type', 'Campaign', \ domain="['|',('section_id','=',section_id),('section_id','=',False)]"), - 'channel_id': fields.many2one('res.partner.canal', 'Channel'), + 'channel_id': fields.many2one('res.partner.canal', 'Lead Source'), 'contact_name': fields.char('Contact Name', size=64), 'partner_name': fields.char("Customer Name", size=64,help='The name of the future partner that will be created while converting the into opportunity'), diff --git a/addons/crm/crm_lead_view.xml b/addons/crm/crm_lead_view.xml index 45f14c3e2df..c98adb86bb9 100644 --- a/addons/crm/crm_lead_view.xml +++ b/addons/crm/crm_lead_view.xml @@ -334,7 +334,7 @@ domain="[('user_id','=', False)]" help="Unassigned Leads" /> - + - + @@ -310,7 +310,7 @@ domain="[]" help="Show Sales Team"/> - + @@ -326,6 +326,7 @@ + diff --git a/addons/crm/crm_phonecall.py b/addons/crm/crm_phonecall.py index 6a4e7bfd7c7..41af82ec8fc 100644 --- a/addons/crm/crm_phonecall.py +++ b/addons/crm/crm_phonecall.py @@ -53,10 +53,10 @@ 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.\ + help='The state is set to \'Todo\', when a case is created.\ \nIf the case is in progress the state is set to \'Open\'.\ \nWhen the case is over, the state is set to \'Done\'.\ \nIf the case needs to be reviewed then the state is set to \'Pending\'.'), @@ -79,14 +79,19 @@ class crm_phonecall(crm_case, osv.osv): the canall which is this opportunity source."), 'date_closed': fields.datetime('Closed', readonly=True), 'date': fields.datetime('Date'), - 'opportunity_id': fields.many2one ('crm.lead', 'Opportunity'), + 'opportunity_id': fields.many2one ('crm.lead', 'Lead/Opportunity'), '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, } @@ -122,14 +127,14 @@ class crm_phonecall(crm_case, osv.osv): return res def case_reset(self, cr, uid, ids, *args): - """Resets case as draft + """Resets case as Todo @param self: The object pointer @param cr: the current row, from the database cursor, @param uid: the current user’s ID for security checks, @param ids: List of case Ids @param *args: Tuple Value for additional Params """ - res = super(crm_phonecall, self).case_reset(cr, uid, ids, args) + res = super(crm_phonecall, self).case_reset(cr, uid, ids, args, 'crm.phonecall') self.write(cr, uid, ids, {'duration': 0.0}) return res 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..55e7657ec05 100644 --- a/addons/crm/crm_phonecall_menu.xml +++ b/addons/crm/crm_phonecall_menu.xml @@ -4,7 +4,7 @@ - Inbound + Logged Calls 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 + Scheduled Calls crm.phonecall form tree,calendar - - + [('state','!=','done')] + - 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. + Scheduled 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. @@ -131,7 +131,7 @@ - diff --git a/addons/crm/crm_phonecall_view.xml b/addons/crm/crm_phonecall_view.xml index 44487e2aef5..2490526bb0e 100644 --- a/addons/crm/crm_phonecall_view.xml +++ b/addons/crm/crm_phonecall_view.xml @@ -31,20 +31,20 @@ - +