[CLEAN] crm_helpdesk: cleaned code before merging.
authorThibault Delavallée <tde@openerp.com>
Fri, 1 Jun 2012 12:20:26 +0000 (14:20 +0200)
committerThibault Delavallée <tde@openerp.com>
Fri, 1 Jun 2012 12:20:26 +0000 (14:20 +0200)
bzr revid: tde@openerp.com-20120601122026-76ti5orvz8jr0kyh

addons/crm_helpdesk/crm_helpdesk.py

index 25a8cee..7a3d73e 100644 (file)
@@ -90,19 +90,11 @@ class crm_helpdesk(base_state, osv.osv):
         'priority': lambda *a: crm.AVAILABLE_PRIORITIES[2][0],
     }
 
-    def case_get_note_msg_prefix(self, cr, uid, id, context=None):
-        return 'Case'
-
     def create(self, cr, uid, vals, context=None):
         obj_id = super(crm_helpdesk, self).create(cr, uid, vals, context)
         self.create_send_note(cr, uid, [obj_id], context=context)
         return obj_id
 
-    def create_send_note(self, cr, uid, ids, context=None):
-        msg = '%s has been <b>created</b>.' % (self.case_get_note_msg_prefix(cr, uid, ids, context=context))
-        self.message_append_note(cr, uid, ids, body=msg, context=context)
-        return True
-
     def message_new(self, cr, uid, msg_dict, custom_values=None, context=None):
         """Automatically called when new email message arrives"""
         res_id = super(crm_helpdesk,self).message_new(cr, uid, msg_dict, custom_values=custom_values, context=context)
@@ -156,9 +148,15 @@ class crm_helpdesk(base_state, osv.osv):
     # ******************************
     # OpenChatter
     # ******************************
-    
+
     def case_get_note_msg_prefix(self, cr, uid, id, context=None):
-        return 'Helpdesk'
+        """ override of default base_state method. """
+        return 'Case'
 
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+    def create_send_note(self, cr, uid, ids, context=None):
+        msg = '%s has been <b>created</b>.' % (self.case_get_note_msg_prefix(cr, uid, ids, context=context))
+        self.message_append_note(cr, uid, ids, body=msg, context=context)
+        return True
 
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: