From 95b83f741efe93d8e9749dd0e6a149b09b9d5bdb Mon Sep 17 00:00:00 2001 From: ssi Date: Thu, 4 Nov 2010 18:44:26 +0530 Subject: [PATCH] [FIX]Idea: solved problem of visibility(If True creator of the idea will be visible to others) not working. added this functionaliy on write too. bzr revid: ssi@tinyerp.com-20101104131426-nag4b2ay79irgpjd --- addons/idea/idea.py | 12 +++++++++--- addons/idea/idea_view.xml | 1 + 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/addons/idea/idea.py b/addons/idea/idea.py index b7b7840a3f5..46f59a23f1a 100644 --- a/addons/idea/idea.py +++ b/addons/idea/idea.py @@ -200,12 +200,10 @@ class idea_idea(osv.osv): @return: Returns an id of the new record """ visibility = False - if vals.get('category_id', False): category_pool = self.pool.get('idea.category') category = category_pool.browse(cr, user, vals.get('category_id'), context) visibility = category.visibility - vals.update({ 'visibility':visibility }) @@ -252,7 +250,15 @@ class idea_idea(osv.osv): if vals.get('my_vote', False): if vals.get('state', state) != 'open': raise osv.except_osv(_("Warning !"), _("Draft/Accepted/Cancelled ideas Could not be voted")) - + + visibility = False + if vals.get('category_id', False): + category_pool = self.pool.get('idea.category') + category = category_pool.browse(cr, user, vals.get('category_id'), context) + visibility = category.visibility + vals.update({ + 'visibility':visibility + }) res = super(idea_idea, self).write(cr, user, ids, vals, context) return res diff --git a/addons/idea/idea_view.xml b/addons/idea/idea_view.xml index c41ab7e82c6..4a3067ff046 100644 --- a/addons/idea/idea_view.xml +++ b/addons/idea/idea_view.xml @@ -199,6 +199,7 @@ +