diff options
| author | Thibault Delavallée <tde@openerp.com> | 2012-09-20 09:48:50 +0200 |
|---|---|---|
| committer | Thibault Delavallée <tde@openerp.com> | 2012-09-20 09:48:50 +0200 |
| commit | bcbae5e2777b396bae25e2b507d913e4ff517b8f (patch) | |
| tree | 8839a77ec44fbcd05d60498b87d80e4efaaf6fff /addons/note/note.py | |
| parent | 52b33a8044819fc7975be2f9acda6e8d8ef25e8a (diff) | |
| parent | 8e6135b43a2c38785c0575d142da4004224174f8 (diff) | |
[MERGE] Merged with addons/trunk, with lots of conflicts to solve...
bzr revid: tde@openerp.com-20120920074850-7p7or1ze8555fya5
Diffstat (limited to 'addons/note/note.py')
| -rw-r--r-- | addons/note/note.py | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/addons/note/note.py b/addons/note/note.py index a7bad7f6a55..fb3f0cee853 100644 --- a/addons/note/note.py +++ b/addons/note/note.py @@ -63,11 +63,8 @@ class note_note(osv.osv): def _get_note_first_line(self, cr, uid, ids, name="", args={}, context=None): res = {} for note in self.browse(cr, uid, ids, context=context): - text_note = (note.memo or '').strip().split('\n')[0] - text_note = re.sub(r'(\S?)(<br[ /]*>|<[/]?p>|<[/]?div>|<table>)[\s\S]*',r'\1',text_note) - text_note = re.sub(r'<[^>]+>','',text_note) - text_note = html2plaintext(text_note) - res[note.id] = text_note + res[note.id] = (note.memo and html2plaintext(note.memo) or "").strip().replace('*','').split("\n")[0] + return res #unactivate a sticky note and record the date @@ -98,7 +95,8 @@ class note_note(osv.osv): def _set_stage_per_user(self, cr, uid, id, name, value, args=None, context=None): note = self.browse(cr, uid, id, context=context) if not value: return False - return self.write(cr, uid, [id], {'stage_ids': [(4, value)]}, context=context) + stage_ids = [value] + [stage.id for stage in note.stage_ids if stage.user_id.id != uid ] + return self.write(cr, uid, [id], {'stage_ids': [(6, 0, stage_ids)]}, context=context) def _get_stage_per_user(self, cr, uid, ids, name, args, context=None): result = dict.fromkeys(ids, False) |
