diff --git a/addons/idea/__openerp__.py b/addons/idea/__openerp__.py index c297d428eb3..0db86965870 100644 --- a/addons/idea/__openerp__.py +++ b/addons/idea/__openerp__.py @@ -45,7 +45,9 @@ 'demo_xml': [ "idea_data.xml" ], - 'test':['test/test_idea.yml'], + 'test':[ + 'test/test_idea.yml' + ], 'installable': True, 'certificate': '0071515601309', } diff --git a/addons/idea/test/test_idea.yml b/addons/idea/test/test_idea.yml index c1ee6deb80f..6714fbfc7e2 100644 --- a/addons/idea/test/test_idea.yml +++ b/addons/idea/test/test_idea.yml @@ -87,9 +87,10 @@ - !record {model: idea.idea, id: idea.idea_idea_0}: comment_ids: - - content: We can learn many things from technical presentation + - content: "We can learn many things from technical presentation" idea_id: idea.idea_idea_0 user_id: res_users_user1 + - | I connect as Manager and close this idea by click on "Close" button. - @@ -100,4 +101,4 @@ - !assert {model: idea.idea, id: idea_idea_0}: - state == 'close' - \ No newline at end of file + diff --git a/addons/idea/wizard/idea_post_vote.py b/addons/idea/wizard/idea_post_vote.py index 73d917603a6..f68496c8ae5 100644 --- a/addons/idea/wizard/idea_post_vote.py +++ b/addons/idea/wizard/idea_post_vote.py @@ -93,19 +93,21 @@ class idea_post_vote(osv.osv_memory): for do_vote_obj in self.read(cr, uid, ids): score = str(do_vote_obj['vote']) - comment = do_vote_obj['note'] + comment = do_vote_obj.get('note', False) vote = { 'idea_id': vote_id, 'user_id': uid, 'score': score } - comment = { - 'user_id':uid, - 'idea_id':vote_id, - 'content': comment, - } + if comment: + comment = { + 'user_id':uid, + 'idea_id':vote_id, + 'content': comment, + } + comment = comment_pool.create(cr, uid, comment) + vote = vote_pool.create(cr, uid, vote) - comment = comment_pool.create(cr, uid, comment) return {} idea_post_vote()