diff --git a/addons/idea/__terp__.py b/addons/idea/__terp__.py
index c56d89e669a..f373506e3f1 100644
--- a/addons/idea/__terp__.py
+++ b/addons/idea/__terp__.py
@@ -30,7 +30,7 @@
'depends': ['base'],
'init_xml': [],
'update_xml': [
- 'idea_wizard.xml',
+ 'wizard/idea_post_vote_view.xml',
'idea_view.xml',
'idea_workflow.xml',
'security/idea_security.xml',
diff --git a/addons/idea/idea_view.xml b/addons/idea/idea_view.xml
index f80e7156f04..9ccc56464d0 100644
--- a/addons/idea/idea_view.xml
+++ b/addons/idea/idea_view.xml
@@ -166,7 +166,7 @@
-
+
diff --git a/addons/idea/idea_wizard.xml b/addons/idea/idea_wizard.xml
deleted file mode 100644
index 206be1dfcaf..00000000000
--- a/addons/idea/idea_wizard.xml
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
-
-
-
-
-
-
-
diff --git a/addons/idea/wizard/__init__.py b/addons/idea/wizard/__init__.py
index 2db6aa6982c..2e6f6d42096 100644
--- a/addons/idea/wizard/__init__.py
+++ b/addons/idea/wizard/__init__.py
@@ -18,5 +18,5 @@
# along with this program. If not, see .
#
##############################################################################
-import idea_vote
+import idea_post_vote
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/idea/wizard/idea_post_vote.py b/addons/idea/wizard/idea_post_vote.py
new file mode 100644
index 00000000000..901f2c0a28d
--- /dev/null
+++ b/addons/idea/wizard/idea_post_vote.py
@@ -0,0 +1,54 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Copyright (C) 2004-2010 Tiny SPRL ().
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see .
+#
+##############################################################################
+from osv import fields, osv
+
+class idea_post_vote(osv.osv_memory):
+
+ _name = "idea.post.vote"
+ _description = "Post vote"
+ _columns = {
+ 'vote': fields.selection([('-1', 'Not Voted'),
+ ('0', 'Very Bad'),
+ ('25', 'Bad'),
+ ('50', 'Normal'),
+ ('75', 'Good'),
+ ('100', 'Very Good') ], 'Post Vote', required=True)
+ }
+
+ def do_vote(self, cr, uid, ids, context):
+ """
+ Create idea vote.
+ @param cr: the current row, from the database cursor,
+ @param uid: the current user’s ID for security checks,
+ @param ids: List of Idea Post vote’s IDs.
+ @return: Dictionary {}
+ """
+ vote_obj = self.pool.get('idea.vote')
+ for data in self.read(cr, uid, ids):
+ score = str(data['vote'])
+ dic = {'idea_id': context['active_id'], 'user_id': uid, 'score': score }
+ vote = vote_obj.create(cr, uid, dic)
+ return {}
+
+idea_post_vote()
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+
diff --git a/addons/idea/wizard/idea_post_vote_view.xml b/addons/idea/wizard/idea_post_vote_view.xml
new file mode 100644
index 00000000000..7316340723c
--- /dev/null
+++ b/addons/idea/wizard/idea_post_vote_view.xml
@@ -0,0 +1,49 @@
+
+
+
+
+ idea.post.vote.form
+ idea.post.vote
+ form
+
+
+
+
+
+
+ Vote
+ idea.post.vote
+ form
+ tree,form
+
+ new
+ {'record_id':active_id}
+
+
+
+
+
+
+
+
+
diff --git a/addons/idea/wizard/idea_vote.py b/addons/idea/wizard/idea_vote.py
deleted file mode 100644
index c040aa45be5..00000000000
--- a/addons/idea/wizard/idea_vote.py
+++ /dev/null
@@ -1,63 +0,0 @@
-# -*- coding: utf-8 -*-
-##############################################################################
-#
-# OpenERP, Open Source Management Solution
-# Copyright (C) 2004-2010 Tiny SPRL ().
-#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Affero General Public License as
-# published by the Free Software Foundation, either version 3 of the
-# License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Affero General Public License for more details.
-#
-# You should have received a copy of the GNU Affero General Public License
-# along with this program. If not, see .
-#
-##############################################################################
-
-import wizard
-import ir
-from mx.DateTime import now
-import pooler
-import netsvc
-
-vote_form = """
-"""
-
-vote_fields = {
- 'vote': {'string': 'Post Vote', 'type': 'selection',
- 'selection': [('-1','Not Voted'),('0','Very Bad'),('25', 'Bad'),('50','Normal'),('75','Good'),('100','Very Good') ]},
-}
-
-
-
-class idea_vote(wizard.interface):
- def _do_vote(self, cr, uid, data, context):
- pool = pooler.get_pool(cr.dbname)
- vote_obj = pool.get('idea.vote')
- score=str(data['form']['vote'])
- dic={'idea_id' : data['id'], 'user_id' : uid, 'score' : score }
- vote=vote_obj.create(cr,uid,dic)
- return True
-
- states = {
- 'init':{
- 'actions': [],
- 'result': {'type':'form', 'arch':vote_form, 'fields':vote_fields, 'state':[('end', 'Cancel'), ('post', 'Post Vote')] },
- },
- 'post':{
- 'actions': [],
- 'result': {'type':'action', 'action': _do_vote, 'state':'end'},
- },
- }
-idea_vote('idea.post.vote')
-
-
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
-