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 | |
| 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')
| -rw-r--r-- | addons/note/__openerp__.py | 6 | ||||
| -rw-r--r-- | addons/note/note.py | 10 | ||||
| -rw-r--r-- | addons/note/note_demo.xml | 22 | ||||
| -rw-r--r-- | addons/note/note_view.xml | 11 |
4 files changed, 21 insertions, 28 deletions
diff --git a/addons/note/__openerp__.py b/addons/note/__openerp__.py index 7d6cac5b85b..2c6134e5e3a 100644 --- a/addons/note/__openerp__.py +++ b/addons/note/__openerp__.py @@ -20,7 +20,7 @@ ############################################################################## { - 'name': 'Memos', + 'name': 'Notes', 'version': '1.0', 'category': 'Tools', 'description': """ @@ -28,12 +28,12 @@ This module allows users to create their own notes inside OpenERP ================================================================= Use notes to write meeting minutes, organize ideas, organize personnal todo -lists, etc. Each user manages his own personnal memos. Notes are available to +lists, etc. Each user manages his own personnal Notes. Notes are available to their authors only, but they can share notes to others users so that several people can work on the same note in real time. It's very efficient to share meeting minutes. -Memos can be found in the 'Home' menu. +Notes can be found in the 'Home' menu. """, 'author': 'OpenERP SA', 'website': 'http://openerp.com', 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) diff --git a/addons/note/note_demo.xml b/addons/note/note_demo.xml index 1cc1b2fc790..16fa5a3f66b 100644 --- a/addons/note/note_demo.xml +++ b/addons/note/note_demo.xml @@ -28,7 +28,7 @@ <record id="note_1" model="note.note"> <field name="name">Customer report #349872</field> - <field name="memo"><![CDATA[Customer report #349872 + <field name="memo"><![CDATA[<b>Customer report #349872</b> <br/><br/>* Calendar app in Home <br/>* The base_calendar module should create a menu in Home, like described above. <br/>* This module should become a main application (in the first screen at installation) @@ -40,7 +40,7 @@ </record> <record id="note_2" model="note.note"> - <field name="memo"><![CDATA[Call Fabien + <field name="memo"><![CDATA[<b>Call Fabien</b> <br/><br/>* Followed by the telephone conversation and mail about D.544.3 ]]> </field> @@ -48,21 +48,21 @@ </record> <record id="note_3" model="note.note"> - <field name="memo"><![CDATA[Call Marc + <field name="memo"><![CDATA[<b>Call Marc</b> <br/><br/>]]> </field> <field name="stage_id" ref="note_stage_01"/> </record> <record id="note_4" model="note.note"> - <field name="memo"><![CDATA[Project N.947.5 + <field name="memo"><![CDATA[<b>Project N.947.5</b> <br/><br/>]]> </field> <field name="stage_id" ref="note_stage_02"/> </record> <record id="note_5" model="note.note"> - <field name="memo"><![CDATA[Shop for family dinner + <field name="memo"><![CDATA[<b>Shop for family dinner</b> <br/>* stuffed turkey <br/>* wine ]]> @@ -71,7 +71,7 @@ </record> <record id="note_6" model="note.note"> - <field name="memo"><![CDATA[Idea to develop + <field name="memo"><![CDATA[<b>Idea to develop</b> <br/><br/>* Create a module note_pad it transforms the html editable memo text field into widget='pad', similar to project_pad depends on 'memo' and 'pad' modules ]]> @@ -80,7 +80,7 @@ </record> <record id="note_7" model="note.note"> - <field name="memo"><![CDATA[Read some documentation about OpenERP before diving into the code + <field name="memo"><![CDATA[<b>Read some documentation about OpenERP before diving into the code</b> <br/><br/>* Open ERP: a modern approach to integrated business management <br/>* Open ERP for Retail and Industrial Management ]]> @@ -89,7 +89,7 @@ </record> <record id="note_8" model="note.note"> - <field name="memo"><![CDATA[New computer specs + <field name="memo"><![CDATA[<b>New computer specs</b> <br/><br/>* Motherboard according to processor <br/>* Processor @@ -111,7 +111,7 @@ </record> <record id="note_9" model="note.note"> - <field name="memo"><![CDATA[Read those books + <field name="memo"><![CDATA[<b>Read those books</b> <br/><br/>* Open ERP: a modern approach to integrated business management <br/>* Open ERP for Retail and Industrial Management ]]> @@ -120,7 +120,7 @@ </record> <record id="note_10" model="note.note"> - <field name="memo"><![CDATA[Read some documentation about OpenERP before diving into the code + <field name="memo"><![CDATA[<b>Read some documentation about OpenERP before diving into the code</b> <br/><br/>* Open ERP: a modern approach to integrated business management <br/>* Open ERP for Retail and Industrial Management ]]> @@ -129,7 +129,7 @@ </record> <record id="note_12" model="note.note"> - <field name="memo"><![CDATA[Read some documentation about OpenERP before diving into the code + <field name="memo"><![CDATA[<b>Read some documentation about OpenERP before diving into the code</b> <br/><br/>* Open ERP: a modern approach to integrated business management <br/>* Open ERP for Retail and Industrial Management ]]> diff --git a/addons/note/note_view.xml b/addons/note/note_view.xml index 22dd5f64810..45d17eaf652 100644 --- a/addons/note/note_view.xml +++ b/addons/note/note_view.xml @@ -1,8 +1,6 @@ <?xml version="1.0"?> <openerp> <data> - <menuitem name="Organizer" id="note_my_stuff" parent="mail.mail_feeds_main"/> - <!-- note Stage Form View --> <record model="ir.ui.view" id="view_note_stage_form"> <field name="name">note.stage.form</field> @@ -38,8 +36,6 @@ <field name="domain">[('user_id','=',uid)]</field> </record> - <menuitem name="Categories" id="menu_notes_stage" parent="note_my_stuff" action="action_note_stage" sequence="40" groups="base.group_no_one"/> - <!-- New note Kanban View --> <record model="ir.ui.view" id="view_note_note_kanban"> <field name="name">note.note.kanban</field> @@ -117,12 +113,10 @@ <field name="arch" type="xml"> <form string="Note" version="7.0"> <header> + <field name="tag_ids" widget="many2many_tags" class="oe_inline" placeholder="Tags"/> <field name="stage_id" domain="[('user_id','=',uid)]" widget="statusbar" clickable="1"/> </header> <field name="memo" widget="html"/><!-- editor_width="100%%" editor_height="60%%" --> - <group groups="note.group_note_tags" col="2"> - <field name="tag_ids" widget="many2many_tags"/> - </group> <div class="oe_chatter"> <field name="message_is_follower" invisible="1"/> <field name="message_ids" widget="mail_thread"/> @@ -188,7 +182,8 @@ <field name="context">{'search_default_open_true':True}</field> </record> - <menuitem name="Notes" id="note_notes" parent="note_my_stuff" sequence="20" action="action_note_note"/> + <menuitem name="Notes" id="menu_note_notes" parent="mail.mail_my_stuff" sequence="20" action="note.action_note_note"/> + <menuitem name="Categories" id="menu_notes_stage" parent="mail.mail_my_stuff" action="note.action_note_stage" sequence="21" groups="base.group_no_one"/> </data> </openerp> |
