diff --git a/addons/crm/crm.py b/addons/crm/crm.py index d0fafbf1cf4..e0d609a43dd 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): diff --git a/addons/crm/crm_phonecall.py b/addons/crm/crm_phonecall.py index fa32c1b28b1..4ace2163c2e 100644 --- a/addons/crm/crm_phonecall.py +++ b/addons/crm/crm_phonecall.py @@ -54,9 +54,9 @@ class crm_phonecall(crm_case, osv.osv): ('open', 'Todo'), ('cancel', 'Cancelled'), ('done', 'Held'), - ('pending', 'Pending'), + ('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\'.'), @@ -126,14 +126,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_view.xml b/addons/crm/crm_phonecall_view.xml index ee732c62f9c..2490526bb0e 100644 --- a/addons/crm/crm_phonecall_view.xml +++ b/addons/crm/crm_phonecall_view.xml @@ -35,16 +35,16 @@