[CLEAN] crm_claim: pending case is back; also deleted unnecessary code.
authorThibault Delavallée <tde@openerp.com>
Tue, 22 May 2012 15:07:06 +0000 (17:07 +0200)
committerThibault Delavallée <tde@openerp.com>
Tue, 22 May 2012 15:07:06 +0000 (17:07 +0200)
bzr revid: tde@openerp.com-20120522150706-fq4a6ic54migbyuf

addons/crm_claim/crm_claim.py

index 408f6da..95acae0 100644 (file)
@@ -31,38 +31,13 @@ wizard.mail_compose_message.SUPPORTED_MODELS.append('crm.claim')
 CRM_CLAIM_PENDING_STATES = (
     crm.AVAILABLE_STATES[2][0], # Cancelled
     crm.AVAILABLE_STATES[3][0], # Done
+    crm.AVAILABLE_STATES[4][0], # Pending
 )
 
 
 class crm_claim(crm.crm_case, osv.osv):
+    """ Crm claim
     """
-    Crm claim
-    """
-    
-    def _get_state(self, cr, uid, ids, name, arg, context=None):
-        res = {}
-        for claim in self.browse(cr, uid, ids, context=context):
-            if claim.stage_id:
-                res[claim.id] = claim.stage_id.state
-        return res
-
-    def _get_stage(self, cr, uid, ids, context=None):
-        claim_obj = self.pool.get('crm.claim')
-        result = {}
-        for stage in self.browse(cr, uid, ids, context=context):
-            if stage.state:
-                claim_ids = claim_obj.search(cr, uid, [('state', '=', stage.state)], context=context)
-        for claim in claim_obj.browse(cr, uid, claim_ids, context=context):
-            result[claim.id] = True
-        return result.keys()
-
-    def _save_state(self, cr, uid, claim_id, field_name, field_value, arg, context=None):
-        stage_ids = self.pool.get('crm.case.stage').search(cr, uid, [('state', '=', field_value)], context=context)
-        if stage_ids:
-            return self.write(cr, uid, claim_id, {'stage_id': stage_ids[0]}, context=context)
-        else:
-            return cr.execute("""UPDATE crm_claim SET state=%s WHERE id=%s""", (field_value, claim_id, ))
-
     _name = "crm.claim"
     _description = "Claim"
     _order = "priority,date desc"