if not context:
context = {}
stage_pool = self.pool.get('crm.case.stage')
- stage_type = context and context.get('stage_type','lead') or self._name.split('.')[1]
+ stage_type = context and context.get('stage_type','')
current_seq = False
for case in self.browse(cr, uid, ids, context):
next_stage = False
if not context:
context = {}
stage_pool = self.pool.get('crm.case.stage')
- stage_type = context and context.get('stage_type','lead') or self._name.split('.')[1]
+ stage_type = context and context.get('stage_type','')
for case in self.browse(cr, uid, ids, context):
prev_stage = False
data = {}
@param uid: the current user’s ID for security checks,
@param context: A standard dictionary for contextual values
"""
- type = context and context.get('stage_type', '') or ''
+ if context is None:
+ context = {}
+ type = context and context.get('stage_type', '')
stage_ids = self.pool.get('crm.case.stage').search(cr, uid, [('type','=',type),('sequence','>=',1)])
- return stage_ids and stage_ids[0]
+ return stage_ids and stage_ids[0] or False
_defaults = {
'active': lambda *a: 1,
@param uid: the current user’s ID for security checks,
@param context: A standard dictionary for contextual values
"""
- type = context and context.get('stage_type', '') or ''
+ if context is None:
+ context = {}
+ type = context and context.get('stage_type', '')
stage_ids = self.pool.get('crm.case.stage').search(cr, uid, [('type','=',type),('sequence','>=',1)])
- return stage_ids and stage_ids[0]
+ return stage_ids and stage_ids[0] or False
_defaults = {
'user_id': crm.crm_case._get_default_user,