[IMP] crm_case: removed generic notification when changing state. Messages are now delegated to upper modules, that will have to write consistent and useful notifications.

bzr revid: tde@openerp.com-20120220111705-4q7x3ukgvnz3vhe1
This commit is contained in:
Thibault Delavallée
2012-02-20 12:17:05 +01:00
parent b23dd504c4
commit b8612374d7
-6
View File
@@ -393,7 +393,6 @@ class crm_case(crm_base):
def case_open(self, cr, uid, ids, *args):
"""Opens Case"""
cases = self.browse(cr, uid, ids)
self.message_append(cr, uid, cases, _('Open'))
for case in cases:
data = {'state': 'open', 'active': True }
if not case.user_id:
@@ -406,7 +405,6 @@ class crm_case(crm_base):
"""Closes Case"""
cases = self.browse(cr, uid, ids)
cases[0].state # to fill the browse record cache
self.message_append(cr, uid, cases, _('Close'))
self.write(cr, uid, ids, {'state': 'done',
'date_closed': time.strftime('%Y-%m-%d %H:%M:%S'),
})
@@ -430,7 +428,6 @@ class crm_case(crm_base):
raise osv.except_osv(_('Error !'), _('You can not escalate, you are already at the top level regarding your sales-team category.'))
self.write(cr, uid, [case.id], data)
cases = self.browse(cr, uid, ids)
self.message_append(cr, uid, cases, _('Escalate'))
self._action(cr, uid, cases, 'escalate')
return True
@@ -438,7 +435,6 @@ class crm_case(crm_base):
"""Cancels Case"""
cases = self.browse(cr, uid, ids)
cases[0].state # to fill the browse record cache
self.message_append(cr, uid, cases, _('Cancel'))
self.write(cr, uid, ids, {'state': 'cancel',
'active': True})
self._action(cr, uid, cases, 'cancel')
@@ -451,7 +447,6 @@ class crm_case(crm_base):
"""Marks case as pending"""
cases = self.browse(cr, uid, ids)
cases[0].state # to fill the browse record cache
self.message_append(cr, uid, cases, _('Pending'))
self.write(cr, uid, ids, {'state': 'pending', 'active': True})
self._action(cr, uid, cases, 'pending')
return True
@@ -463,7 +458,6 @@ class crm_case(crm_base):
state = 'open'
cases = self.browse(cr, uid, ids)
cases[0].state # to fill the browse record cache
self.message_append(cr, uid, cases, _('Draft'))
self.write(cr, uid, ids, {'state': state, 'active': True})
self._action(cr, uid, cases, state)
return True