From 6e8660a776fdf582535776eb5b199cd256822961 Mon Sep 17 00:00:00 2001 From: "Foram Katharotiya (OpenERP)" Date: Fri, 31 Aug 2012 12:05:24 +0530 Subject: [PATCH 1/2] [IMP] Add data of subtype in idea bzr revid: fka@tinyerp.com-20120831063524-bnvxkie4tgsjxjsq --- addons/idea/idea.py | 8 ++++---- addons/idea/idea_data.xml | 29 +++++++++++++++++++++++++++++ 2 files changed, 33 insertions(+), 4 deletions(-) diff --git a/addons/idea/idea.py b/addons/idea/idea.py index e2e5ec50ddf..a20ddf51414 100644 --- a/addons/idea/idea.py +++ b/addons/idea/idea.py @@ -67,21 +67,21 @@ class idea_idea(osv.osv): def idea_cancel(self, cr, uid, ids, context={}): self.write(cr, uid, ids, { 'state': 'cancel' }) - self.message_post(cr, uid, ids, body=_('Idea canceled.'), context=context) + self.message_post(cr, uid, ids, body=_('Idea canceled.'), subtype="cancel", context=context) return True def idea_open(self, cr, uid, ids, context={}): self.write(cr, uid, ids, { 'state': 'open'}) - self.message_post(cr, uid, ids, body=_('Idea accepted.'), context=context) + self.message_post(cr, uid, ids, body=_('Idea accepted.'), subtype="open", context=context) return True def idea_close(self, cr, uid, ids, context={}): - self.message_post(cr, uid, ids, body=_('Idea done.'), context=context) + self.message_post(cr, uid, ids, body=_('Idea done.'), subtype="close", context=context) self.write(cr, uid, ids, { 'state': 'close' }) return True def idea_draft(self, cr, uid, ids, context={}): - self.message_post(cr, uid, ids, body=_('Idea reset to draft.'), context=context) + self.message_post(cr, uid, ids, body=_('Idea reset to draft.'), subtype="new", context=context) self.write(cr, uid, ids, { 'state': 'draft' }) return True idea_idea() diff --git a/addons/idea/idea_data.xml b/addons/idea/idea_data.xml index d63eb907ef8..a4cd4970511 100644 --- a/addons/idea/idea_data.xml +++ b/addons/idea/idea_data.xml @@ -15,6 +15,35 @@ + + + + new + + + + + open + + + + cancel + + + + + close + + + + + + + + + + + From 6c56f95e869f21d5eaecb3c3eda1de831e1d5499 Mon Sep 17 00:00:00 2001 From: "Foram Katharotiya (OpenERP)" Date: Fri, 31 Aug 2012 16:34:43 +0530 Subject: [PATCH 2/2] [IMP] improve code bzr revid: fka@tinyerp.com-20120831110443-55nxhelq1dfl073j --- addons/idea/idea.py | 2 +- addons/idea/idea_data.xml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/addons/idea/idea.py b/addons/idea/idea.py index a20ddf51414..ff55e6afbc3 100644 --- a/addons/idea/idea.py +++ b/addons/idea/idea.py @@ -67,7 +67,7 @@ class idea_idea(osv.osv): def idea_cancel(self, cr, uid, ids, context={}): self.write(cr, uid, ids, { 'state': 'cancel' }) - self.message_post(cr, uid, ids, body=_('Idea canceled.'), subtype="cancel", context=context) + self.message_post(cr, uid, ids, body=_('Idea canceled.'), subtype="cancelled", context=context) return True def idea_open(self, cr, uid, ids, context={}): diff --git a/addons/idea/idea_data.xml b/addons/idea/idea_data.xml index a4cd4970511..17401f72f98 100644 --- a/addons/idea/idea_data.xml +++ b/addons/idea/idea_data.xml @@ -26,8 +26,8 @@ open - - cancel + + cancelled