From 568b5315e1600ccf969fac0a99e4ef59f2915138 Mon Sep 17 00:00:00 2001 From: "ksa (Open ERP)" Date: Wed, 17 Aug 2011 17:52:09 +0530 Subject: [PATCH] [IMP]: method for find percentage for stage in crm bzr revid: ksa@tinyerp.co.in-20110817122209-1u82d7otgjyo8df8 --- addons/crm/crm.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/addons/crm/crm.py b/addons/crm/crm.py index cb528818012..32f97112859 100644 --- a/addons/crm/crm.py +++ b/addons/crm/crm.py @@ -213,20 +213,20 @@ class crm_case(crm_base): """ def _find_lost_stage(self, cr, uid, type, section_id): - return self._find_percent_stage(cr, uid, 0.0, type, section_id) + return self._find_percent_stage(cr, uid, 0.0, section_id) def _find_won_stage(self, cr, uid, type, section_id): - return self._find_percent_stage(cr, uid, 100.0, type, section_id) + return self._find_percent_stage(cr, uid, 100.0, section_id) - def _find_percent_stage(self, cr, uid, percent, type, section_id): + def _find_percent_stage(self, cr, uid, percent, section_id): """ Return the first stage with a probability == percent """ stage_pool = self.pool.get('crm.case.stage') if section_id : - ids = stage_pool.search(cr, uid, [("probability", '=', percent), ("type", 'like', type), ("section_ids", 'in', [section_id])]) + ids = stage_pool.search(cr, uid, [("probability", '=', percent), ("section_ids", 'in', [section_id])]) else : - ids = stage_pool.search(cr, uid, [("probability", '=', percent), ("type", 'like', type)]) + ids = stage_pool.search(cr, uid, [("probability", '=', percent)]) if ids: return ids[0]