diff --git a/addons/idea/__init__.py b/addons/idea/__init__.py
index e9243780570..2aa68d00eff 100644
--- a/addons/idea/__init__.py
+++ b/addons/idea/__init__.py
@@ -20,5 +20,6 @@
##############################################################################
import idea
+import wizard
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/idea/__terp__.py b/addons/idea/__terp__.py
index beaccca5a54..c56d89e669a 100644
--- a/addons/idea/__terp__.py
+++ b/addons/idea/__terp__.py
@@ -30,10 +30,11 @@
'depends': ['base'],
'init_xml': [],
'update_xml': [
+ 'idea_wizard.xml',
'idea_view.xml',
'idea_workflow.xml',
'security/idea_security.xml',
- 'security/ir.model.access.csv'
+ 'security/ir.model.access.csv',
],
'demo_xml': [],
'installable': True,
diff --git a/addons/idea/idea.py b/addons/idea/idea.py
index 518ff4808a5..195140e99ba 100644
--- a/addons/idea/idea.py
+++ b/addons/idea/idea.py
@@ -174,6 +174,7 @@ class idea_vote(osv.osv):
'score': fields.selection( VoteValues, 'Score', required=True)
}
_defaults = {
+ #'user_id': lambda self, cr, uid, context: uid,
'score': lambda *a: DefaultVoteValue,
}
idea_vote()
diff --git a/addons/idea/idea_view.xml b/addons/idea/idea_view.xml
index 1dd97ab5f9b..64401748e62 100644
--- a/addons/idea/idea_view.xml
+++ b/addons/idea/idea_view.xml
@@ -113,7 +113,7 @@
-
+
@@ -131,6 +131,9 @@
+
+
+
@@ -161,6 +164,7 @@
+
@@ -204,7 +208,7 @@
tree,form
-
+
Open Ideas
diff --git a/addons/idea/idea_wizard.xml b/addons/idea/idea_wizard.xml
new file mode 100644
index 00000000000..206be1dfcaf
--- /dev/null
+++ b/addons/idea/idea_wizard.xml
@@ -0,0 +1,14 @@
+
+
+
+
+
+
+
+
+
diff --git a/addons/idea/wizard/__init__.py b/addons/idea/wizard/__init__.py
new file mode 100644
index 00000000000..2db6aa6982c
--- /dev/null
+++ b/addons/idea/wizard/__init__.py
@@ -0,0 +1,22 @@
+# -*- 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 idea_vote
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/idea/wizard/idea_vote.py b/addons/idea/wizard/idea_vote.py
new file mode 100644
index 00000000000..c040aa45be5
--- /dev/null
+++ b/addons/idea/wizard/idea_vote.py
@@ -0,0 +1,63 @@
+# -*- 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:
+