diff --git a/addons/idea/__init__.py b/addons/idea/__init__.py index 8b550800117..2b8966f9e7a 100644 --- a/addons/idea/__init__.py +++ b/addons/idea/__init__.py @@ -19,5 +19,4 @@ # ############################################################################## -import idea - +import models diff --git a/addons/idea/__openerp__.py b/addons/idea/__openerp__.py index 878342d6d00..bc2308ecc44 100644 --- a/addons/idea/__openerp__.py +++ b/addons/idea/__openerp__.py @@ -22,29 +22,36 @@ { 'name': 'Ideas', - 'version': '0.1', + 'summary': 'Share and Vote for your Ideas', + 'version': '1.0', 'category': 'Tools', 'description': """ -This module allows user to easily and efficiently participate in enterprise innovation. -======================================================================================= +Share your ideas and participate in enterprise innovation +========================================================= -It allows everybody to express ideas about different subjects. -Then, other users can comment on these ideas and vote for particular ideas. -Each idea has a score based on the different votes. -The managers can obtain an easy view of best ideas from all the users. +The Ideas module give users a way to express and discuss ideas, allowing everybody +to participate in enterprise innovation. Every user can suggest, comment ideas. +A vote mechanism is included. Each idea has a score based on the different +votes. The managers can obtain an easy view of best ideas from all the users. Once installed, check the menu 'Ideas' in the 'Tools' main menu.""", 'author': 'OpenERP SA', - 'website': 'http://openerp.com', - 'depends': ['mail'], + 'website': 'http://www.openerp.com', + 'depends': ['base', 'base_setup'], 'data': [ - 'security/idea_security.xml', + 'security/idea.xml', 'security/ir.model.access.csv', - 'idea_view.xml', - 'idea_workflow.xml', + 'views/idea.xml', + 'data/idea_workflow.xml', + ], + 'demo': [ + 'demo/idea.xml' ], - 'demo': ['idea_data.xml'], - 'test': [], 'installable': True, + 'application': True, 'images': [], + 'css': [], + 'js': [], + 'qweb': [], } + # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/idea/idea_workflow.xml b/addons/idea/data/idea_workflow.xml similarity index 100% rename from addons/idea/idea_workflow.xml rename to addons/idea/data/idea_workflow.xml diff --git a/addons/idea/idea_data.xml b/addons/idea/demo/idea.xml similarity index 75% rename from addons/idea/idea_data.xml rename to addons/idea/demo/idea.xml index 421cb6a9eef..e54708f92ec 100644 --- a/addons/idea/idea_data.xml +++ b/addons/idea/demo/idea.xml @@ -12,10 +12,6 @@ Technical - - - - diff --git a/addons/idea/models/__init__.py b/addons/idea/models/__init__.py new file mode 100644 index 00000000000..e8a48771771 --- /dev/null +++ b/addons/idea/models/__init__.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Business Applications +# Copyright (c) 2013-TODAY OpenERP S.A. +# +# 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 diff --git a/addons/idea/idea.py b/addons/idea/models/idea.py similarity index 96% rename from addons/idea/idea.py rename to addons/idea/models/idea.py index 2cd7a9858d1..5bfcdb0c317 100644 --- a/addons/idea/idea.py +++ b/addons/idea/models/idea.py @@ -32,19 +32,25 @@ class idea_category(osv.osv): """ Category of Idea """ _name = "idea.category" _description = "Idea Category" + _order = 'name asc' + _columns = { 'name': fields.char('Category Name', size=64, required=True), } + _sql_constraints = [ ('name', 'unique(name)', 'The name of the category must be unique') ] - _order = 'name asc' class idea_idea(osv.osv): """ Model of an Idea """ _name = 'idea.idea' - _inherit = ['mail.thread'] + _description = 'Propose and Share your Ideas' + _rec_name = 'name' + _order = 'name asc' + # _inherit = ['mail.thread'] + _columns = { 'create_uid': fields.many2one('res.users', 'Creator', required=True, readonly=True), 'name': fields.char('Idea Summary', size=64, required=True, readonly=True, @@ -67,7 +73,6 @@ class idea_idea(osv.osv): _defaults = { 'state': lambda *a: 'draft', } - _order = 'name asc' def idea_cancel(self, cr, uid, ids, context=None): return self.write(cr, uid, ids, {'state': 'cancel'}, context=context) diff --git a/addons/idea/security/idea.xml b/addons/idea/security/idea.xml new file mode 100644 index 00000000000..e7a0d800187 --- /dev/null +++ b/addons/idea/security/idea.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/addons/idea/security/idea_security.xml b/addons/idea/security/idea_security.xml deleted file mode 100644 index c72608863b0..00000000000 --- a/addons/idea/security/idea_security.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - User - - - - - - diff --git a/addons/idea/security/ir.model.access.csv b/addons/idea/security/ir.model.access.csv index 78b8deeaf57..761ada8132c 100644 --- a/addons/idea/security/ir.model.access.csv +++ b/addons/idea/security/ir.model.access.csv @@ -1,3 +1,3 @@ id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink -access_idea_category_user,idea.category user,model_idea_category,base.group_tool_user,1,1,1,1 -access_idea_idea_user,idea.idea user,model_idea_idea,base.group_tool_user,1,1,1,1 +access_idea_category_user,idea.category.user,model_idea_category,base.group_user,1,1,1,1 +access_idea_idea_user,idea.idea.user,model_idea_idea,base.group_user,1,1,1,1 diff --git a/addons/idea/static/src/img/icon.png b/addons/idea/static/src/img/icon.png new file mode 100644 index 00000000000..1f0cba223bb Binary files /dev/null and b/addons/idea/static/src/img/icon.png differ diff --git a/addons/idea/tests/__init__.py b/addons/idea/tests/__init__.py new file mode 100644 index 00000000000..a53567a380b --- /dev/null +++ b/addons/idea/tests/__init__.py @@ -0,0 +1,28 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Business Applications +# Copyright (c) 2013-TODAY OpenERP S.A. +# +# 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 openerp.addons.idea.tests import test_idea + +checks = [ + test_idea, +] + +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/idea/tests/test_idea.py b/addons/idea/tests/test_idea.py new file mode 100644 index 00000000000..4ca9bb9dcb9 --- /dev/null +++ b/addons/idea/tests/test_idea.py @@ -0,0 +1,39 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Business Applications +# Copyright (c) 2013-TODAY OpenERP S.A. +# +# 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 openerp.tests import common + + +class TestIdeaBase(common.TransactionCase): + + def setUp(self): + super(TestIdeaBase, self).setUp() + cr, uid = self.cr, self.uid + + # Usefull models + self.idea_category = self.registry('idea.category') + self.idea_idea = self.registry('idea.idea') + + def tearDown(self): + super(TestIdeaBase, self).tearDown() + + def test_OO(self): + pass diff --git a/addons/idea/idea_view.xml b/addons/idea/views/idea.xml similarity index 90% rename from addons/idea/idea_view.xml rename to addons/idea/views/idea.xml index e1a4b942e83..85858a9c860 100644 --- a/addons/idea/idea_view.xml +++ b/addons/idea/views/idea.xml @@ -1,9 +1,6 @@ - - - idea.category.search @@ -49,16 +46,6 @@ - - - - - - - idea.idea.form @@ -79,10 +66,6 @@ @@ -128,8 +111,21 @@ + + + + + + + + + id="menu_idea_idea" action="action_idea_idea" sequence="10"/> +