diff --git a/addons/note/note.py b/addons/note/note.py index 2d95b15107a..90c2cb9bc54 100644 --- a/addons/note/note.py +++ b/addons/note/note.py @@ -141,12 +141,19 @@ class note_note(osv.osv): #note without user's stage nb_notes_ws = self.search(cr,uid, domain+[('stage_ids', 'not in', current_stage_ids)], context=context, count=True) if nb_notes_ws: - result += [{ #notes for unknown stage and if stage_ids is not empty - '__context': {'group_by': groupby[1:]}, - '__domain': domain + [('stage_ids', 'not in', current_stage_ids)], - 'stage_id': (0, 'Unknown'), - 'stage_id_count':nb_notes_ws - }] + # add note to the first column if it's the first stage + dom_not_in = ('stage_ids', 'not in', current_stage_ids) + if result and result[0]['stage_id'][0] == current_stage_ids[0]: + dom_in = result[0]['__domain'].pop() + result[0]['__domain'] = domain + ['|', dom_in, dom_not_in] + else: + # add the first stage column + result = [{ + '__context': {'group_by': groupby[1:]}, + '__domain': domain + [dom_not_in], + 'stage_id': (current_stage_ids[0], stage_name[current_stage_ids[0]]), + 'stage_id_count':nb_notes_ws + }] + result else: # if stage_ids is empty @@ -156,7 +163,7 @@ class note_note(osv.osv): result = [{ #notes for unknown stage '__context': {'group_by': groupby[1:]}, '__domain': domain, - 'stage_id': (0, 'Unknown'), + 'stage_id': False, 'stage_id_count':nb_notes_ws }] else: @@ -187,7 +194,7 @@ class res_users(osv.Model): model_id = data_obj.get_object_reference(cr, uid, 'base', 'group_user') #Employee Group group_id = model_id and model_id[1] or False if group_id in [x.id for x in user.groups_id]: - for note_xml_id in ['note_stage_01','note_stage_02','note_stage_03','note_stage_04']: + for note_xml_id in ['note_stage_00','note_stage_01','note_stage_02','note_stage_03','note_stage_04']: data_id = data_obj._get_id(cr, uid, 'note', note_xml_id) stage_id = data_obj.browse(cr, uid, data_id, context=context).res_id note_obj.copy(cr, uid, stage_id, default = { diff --git a/addons/note/note_data.xml b/addons/note/note_data.xml index 592292788b3..376b8e9053f 100644 --- a/addons/note/note_data.xml +++ b/addons/note/note_data.xml @@ -2,6 +2,12 @@ + + New + + + + Today 1