diff options
| author | Fabien Pinckaers <fp@tinyerp.com> | 2012-09-19 16:44:49 +0200 |
|---|---|---|
| committer | Fabien Pinckaers <fp@tinyerp.com> | 2012-09-19 16:44:49 +0200 |
| commit | e4a91b4900a3d7e52cf72bc67c99279c7891e21c (patch) | |
| tree | 9ba9ba4543edc44ea23588b6f89df07836944cc4 /addons/note/note.py | |
| parent | 16f52fcdb8dcce2b2db24d506679729e31fc094e (diff) | |
| parent | 8e3aa494f183f6cc1354c822bc4e3c1c4429ea4b (diff) | |
merge
bzr revid: fp@tinyerp.com-20120919144449-au27d611umh2fr1w
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) |
