From bce7a26912c121be5b7ded10c52a4eaebb27f387 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibault=20Delavall=C3=A9e?= Date: Tue, 18 Jun 2013 15:32:52 +0200 Subject: [PATCH] [ADD] Idea: added a doc directory, containing various patch to apply to add the various messaging / needaction features. bzr revid: tde@openerp.com-20130618133252-c0p6bjsqsdih199d --- addons/idea/doc/apply.txt | 20 ++++++++ addons/idea/doc/patch1_mailthread.txt | 29 ++++++++++++ addons/idea/doc/patch2_needaction.txt | 27 +++++++++++ addons/idea/doc/patch3_treebold.txt | 20 ++++++++ addons/idea/doc/patch4_chatterkanban.txt | 27 +++++++++++ addons/idea/doc/patch5_trackvisibility.txt | 28 +++++++++++ addons/idea/doc/patch6_subtypes.txt | 55 ++++++++++++++++++++++ addons/idea/doc/patch7_messagepost.txt | 31 ++++++++++++ 8 files changed, 237 insertions(+) create mode 100644 addons/idea/doc/apply.txt create mode 100644 addons/idea/doc/patch1_mailthread.txt create mode 100644 addons/idea/doc/patch2_needaction.txt create mode 100644 addons/idea/doc/patch3_treebold.txt create mode 100644 addons/idea/doc/patch4_chatterkanban.txt create mode 100644 addons/idea/doc/patch5_trackvisibility.txt create mode 100644 addons/idea/doc/patch6_subtypes.txt create mode 100644 addons/idea/doc/patch7_messagepost.txt diff --git a/addons/idea/doc/apply.txt b/addons/idea/doc/apply.txt new file mode 100644 index 00000000000..5af4f0582ae --- /dev/null +++ b/addons/idea/doc/apply.txt @@ -0,0 +1,20 @@ +bzr patch idea/doc/patch1_mailthread.txt +bzr ci -m "[IMP] Patch1: added mail_thread inheritance + widgets" + +bzr patch idea/doc/patch2_needaction.txt +bzr ci -m "[IMP] Patch2: added ir_needactionmixin inheritance + unread filter" + +bzr patch idea/doc/patch3_treebold.txt +bzr ci -m "[IMP] Patch3: use message_unread in tree view to put ideas in bold" + +bzr patch idea/doc/patch4_chatterkanban.txt +bzr ci -m "[IMP] Patch4: add chatter data in kanban view" + +bzr patch idea/doc/patch5_trackvisibility.txt +bzr ci -m "[IMP] Patch5: track user_id and state to automatically generate logs." + +bzr patch idea/doc/patch6_subtypes.txt +bzr ci -m "[IMP] Patch6: add a subtype on messages about state changed and idea approved, using automatic tracking." + +bzr patch idea/doc/patch7_messagepost.txt +bzr ci -m "[IMP] Patch7: add a message_post with a subtype" diff --git a/addons/idea/doc/patch1_mailthread.txt b/addons/idea/doc/patch1_mailthread.txt new file mode 100644 index 00000000000..7aeecd54a1f --- /dev/null +++ b/addons/idea/doc/patch1_mailthread.txt @@ -0,0 +1,29 @@ +=== modified file 'idea/models/idea.py' +--- idea/models/idea.py 2013-06-18 10:16:21 +0000 ++++ idea/models/idea.py 2013-06-18 10:16:39 +0000 +@@ -47,6 +47,7 @@ + """ Model of an Idea """ + _name = 'idea.idea' + _description = 'Propose and Share your Ideas' ++ _inherit = ['mail.thread'] + + _rec_name = 'name' + _order = 'name asc' + +=== modified file 'idea/views/idea.xml' +--- idea/views/idea.xml 2013-06-18 10:16:21 +0000 ++++ idea/views/idea.xml 2013-06-18 10:16:47 +0000 +@@ -56,6 +56,12 @@ + + + ++
++ ++ ++
+ +
+ + diff --git a/addons/idea/doc/patch2_needaction.txt b/addons/idea/doc/patch2_needaction.txt new file mode 100644 index 00000000000..6897d597fd3 --- /dev/null +++ b/addons/idea/doc/patch2_needaction.txt @@ -0,0 +1,27 @@ +=== modified file 'idea/models/idea.py' +--- idea/models/idea.py 2013-06-18 10:34:31 +0000 ++++ idea/models/idea.py 2013-06-18 10:36:26 +0000 +@@ -47,7 +47,7 @@ + """ Model of an Idea """ + _name = 'idea.idea' + _description = 'Propose and Share your Ideas' +- _inherit = ['mail.thread'] ++ _inherit = ['mail.thread', 'ir.needaction_mixin'] + + _rec_name = 'name' + _order = 'name asc' + +=== modified file 'idea/views/idea.xml' +--- idea/views/idea.xml 2013-06-18 10:34:31 +0000 ++++ idea/views/idea.xml 2013-06-18 10:36:08 +0000 +@@ -92,6 +92,9 @@ + help="Open Ideas"/> + ++ + + + + diff --git a/addons/idea/doc/patch3_treebold.txt b/addons/idea/doc/patch3_treebold.txt new file mode 100644 index 00000000000..9521837750a --- /dev/null +++ b/addons/idea/doc/patch3_treebold.txt @@ -0,0 +1,20 @@ +=== modified file 'idea/views/idea.xml' +--- idea/views/idea.xml 2013-06-18 13:17:10 +0000 ++++ idea/views/idea.xml 2013-06-18 13:17:57 +0000 +@@ -75,11 +75,14 @@ + idea.idea.tree + idea.idea + +- ++ + + + + ++ + + + + diff --git a/addons/idea/doc/patch4_chatterkanban.txt b/addons/idea/doc/patch4_chatterkanban.txt new file mode 100644 index 00000000000..ccce81db7a6 --- /dev/null +++ b/addons/idea/doc/patch4_chatterkanban.txt @@ -0,0 +1,27 @@ +=== modified file 'idea/views/idea.xml' +--- idea/views/idea.xml 2013-06-18 10:58:33 +0000 ++++ idea/views/idea.xml 2013-06-18 11:03:38 +0000 +@@ -8,6 +8,9 @@ + + + ++ ++ ++ + + +
+@@ -27,6 +30,12 @@ +
+ +
++ ++ +
+
+ + diff --git a/addons/idea/doc/patch5_trackvisibility.txt b/addons/idea/doc/patch5_trackvisibility.txt new file mode 100644 index 00000000000..dd62f44710a --- /dev/null +++ b/addons/idea/doc/patch5_trackvisibility.txt @@ -0,0 +1,28 @@ +=== modified file 'idea/models/idea.py' +--- idea/models/idea.py 2013-06-18 13:29:15 +0000 ++++ idea/models/idea.py 2013-06-18 13:29:38 +0000 +@@ -63,7 +63,8 @@ + return res + + _columns = { +- 'user_id': fields.many2one('res.users', 'Responsible', required=True), ++ 'user_id': fields.many2one('res.users', 'Responsible', required=True, ++ track_visibility='onchange'), + 'name': fields.char('Summary', required=True, readonly=True, + states={'draft': [('readonly', False)]}, + oldname='title'), +@@ -71,9 +72,11 @@ + states={'draft': [('readonly', False)]}, + help='Content of the idea'), + 'category_ids': fields.many2many('idea.category', string='Tags'), +- 'state': fields.selection(_get_state_list, string='Status', required=True), ++ 'state': fields.selection(_get_state_list, string='Status', required=True, ++ track_visibility='onchange'), + 'priority': fields.selection([('low', 'Low'), ('normal', 'Normal'), ('high', 'High')], +- string='Priority', required=True), ++ string='Priority', required=True, ++ track_visibility='always'), + 'color': fields.function(_get_color, type='integer', string='Color Index'), + } + + diff --git a/addons/idea/doc/patch6_subtypes.txt b/addons/idea/doc/patch6_subtypes.txt new file mode 100644 index 00000000000..429b95d57d1 --- /dev/null +++ b/addons/idea/doc/patch6_subtypes.txt @@ -0,0 +1,55 @@ +=== modified file 'idea/__openerp__.py' +--- idea/__openerp__.py 2013-06-18 10:16:21 +0000 ++++ idea/__openerp__.py 2013-06-18 13:23:42 +0000 +@@ -41,6 +41,7 @@ + 'security/ir.model.access.csv', + 'views/idea.xml', + 'views/category.xml', ++ 'data/idea.xml', + 'data/idea_workflow.xml', + ], + 'demo': [ + +=== modified file 'idea/data/idea.xml' +--- idea/data/idea.xml 2013-06-18 13:23:19 +0000 ++++ idea/data/idea.xml 2013-06-18 13:23:56 +0000 +@@ -2,5 +2,19 @@ + + + ++ ++ ++ State Changed ++ idea.idea ++ ++ State changed ++ ++ ++ Idea Approved ++ idea.idea ++ ++ Idea approved ++ ++ + + +\ No newline at end of file + +=== modified file 'idea/models/idea.py' +--- idea/models/idea.py 2013-06-18 13:23:37 +0000 ++++ idea/models/idea.py 2013-06-18 13:23:42 +0000 +@@ -47,6 +47,13 @@ + _rec_name = 'name' + _order = 'name asc' + ++ _track = { ++ 'state': { ++ 'idea.mt_state_approved': lambda self, cr, uid, obj, ctx=None: obj['state'] == 'close', ++ 'idea.mt_state_change': lambda self, cr, uid, obj, ctx=None: obj['state'] != 'close', ++ }, ++ } ++ + def _get_state_list(self, cr, uid, context=None): + return [('draft', 'New'), + ('open', 'In discussion'), + diff --git a/addons/idea/doc/patch7_messagepost.txt b/addons/idea/doc/patch7_messagepost.txt new file mode 100644 index 00000000000..492fef88bdd --- /dev/null +++ b/addons/idea/doc/patch7_messagepost.txt @@ -0,0 +1,31 @@ +=== modified file 'idea/data/idea.xml' +--- idea/data/idea.xml 2013-06-18 13:25:00 +0000 ++++ idea/data/idea.xml 2013-06-18 13:27:58 +0000 +@@ -15,6 +15,11 @@ + + Idea approved + ++ ++ Priority High ++ idea.idea ++ Priority set to high ++ + + + +\ No newline at end of file + +=== modified file 'idea/models/idea.py' +--- idea/models/idea.py 2013-06-18 13:25:00 +0000 ++++ idea/models/idea.py 2013-06-18 13:26:50 +0000 +@@ -136,4 +136,9 @@ + return self.write(cr, uid, ids, {'priority': 'normal'}, context=context) + + def idea_set_high_priority(self, cr, uid, ids, context={}): ++ for idea in self.browse(cr, uid, ids, context=context): ++ self.message_post(cr, uid, ids, body='Your idea has been set as high priority. Congratulations!', ++ subtype='idea.mt_priority_high', ++ partner_ids=[idea.user_id.partner_id.id], ++ context=context) + return self.write(cr, uid, ids, {'priority': 'high'}, context=context) +