[IMP]: improve the idea vore wzard
bzr revid: mga@tinyerp.com-20100520110721-pqmchd3zocbnrac0
This commit is contained in:
parent
9657c3319f
commit
6e8e41be7e
|
@ -150,11 +150,10 @@ class idea_idea(osv.osv):
|
|||
if int(field_value) >= 0:
|
||||
vote_obj.create(cr, uid, {'idea_id': id, 'user_id': uid, 'score': textual_value })
|
||||
|
||||
|
||||
_columns = {
|
||||
'user_id': fields.many2one('res.users', 'Creator', required=True, readonly=True),
|
||||
'title': fields.char('Idea Summary', size=64, required=True),
|
||||
'description': fields.text('Description', required=True, help='Content of the idea'),
|
||||
'description': fields.text('Description', help='Content of the idea'),
|
||||
'comment_ids': fields.one2many('idea.comment', 'idea_id', 'Comments'),
|
||||
'create_date': fields.datetime('Creation date', readonly=True),
|
||||
'vote_ids': fields.one2many('idea.vote', 'idea_id', 'Vote'),
|
||||
|
|
|
@ -152,7 +152,12 @@
|
|||
</field>
|
||||
</page>
|
||||
<page string="Vote" groups="base.group_extended">
|
||||
<field name="vote_ids" nolabel="1" colspan="4" readonly="True"/>
|
||||
<field name="vote_ids" nolabel="1" colspan="4" readonly="True">
|
||||
<tree string="Votes">
|
||||
<field name="user_id"/>
|
||||
<field name="score" />
|
||||
</tree>
|
||||
</field>
|
||||
</page>
|
||||
<page string="Statistics">
|
||||
<group col="6" colspan="4">
|
||||
|
|
|
@ -89,6 +89,7 @@ class idea_post_vote(osv.osv_memory):
|
|||
|
||||
vote_id = context and context.get('active_id', False) or False
|
||||
vote_pool = self.pool.get('idea.vote')
|
||||
idea_pool = self.pool.get('idea.idea')
|
||||
comment_pool = self.pool.get('idea.comment')
|
||||
|
||||
for do_vote_obj in self.read(cr, uid, ids):
|
||||
|
@ -106,8 +107,9 @@ class idea_post_vote(osv.osv_memory):
|
|||
'content': comment,
|
||||
}
|
||||
comment = comment_pool.create(cr, uid, comment)
|
||||
|
||||
vote = vote_pool.create(cr, uid, vote)
|
||||
|
||||
idea_pool._vote_save(cr, uid, vote_id, None, score, context)
|
||||
#vote = vote_pool.create(cr, uid, vote)
|
||||
return {}
|
||||
|
||||
idea_post_vote()
|
||||
|
|
Loading…
Reference in New Issue