[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
This commit is contained in:
ssi
2010-11-04 18:44:26 +05:30
parent 2003469b89
commit 95b83f741e
2 changed files with 10 additions and 3 deletions
+9 -3
View File
@@ -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
+1
View File
@@ -199,6 +199,7 @@
<field name="name" select="1" />
<field name="category_id" select="1"/>
<field name="open_date" select="1"/>
<field name="visibility" invisible="1"/>
<field name="user_id" attrs="{'invisible':[('visibility','=',False)]}"/>
<field name="vote_avg" widget="progressbar"/>
<group col="4" colspan="2">