Merge lp:~openerp-dev/openobject-addons/6.1-opw-574714-skh into lp:openobject-addons/6.1

Proposed by Somesh Khare
Status: Needs review
Proposed branch: lp:~openerp-dev/openobject-addons/6.1-opw-574714-skh
Merge into: lp:openobject-addons/6.1
Diff against target: 29 lines (+8/-3)
1 file modified
idea/idea.py (+8/-3)
To merge this branch: bzr merge lp:~openerp-dev/openobject-addons/6.1-opw-574714-skh
Reviewer Review Type Date Requested Status
Naresh(OpenERP) Pending
Review via email: mp+105446@code.launchpad.net

Description of the change

Hello Sir,

[FIX] Idea : Comments posted along with a vote is not stored/displayed in idea.vote object.

This branch fixes this issue.

Kindly review the branch and please share your views on it.

Thanks
Somesh Khare

To post a comment you must log in.
Revision history for this message
Naresh(OpenERP) (nch-openerp) wrote :

Hello,

This bug was qualified as Not Relevant on Trunk (means that architecture on trunk has changed and so this bug has no meaning anymore). If this Merge Proposal could not be merged in v6.1 at the release of v7.0, it will be closed.

Thanks,
Naresh Soni

Unmerged revisions

6795. By Somesh Khare

[FIX] Idea : Comments posted along with a vote is not stored/displayed in idea.vote object (Case: Ref 574714)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'idea/idea.py'
2--- idea/idea.py 2011-12-31 07:57:20 +0000
3+++ idea/idea.py 2012-05-11 07:26:18 +0000
4@@ -160,17 +160,22 @@
5 @param ids: List of vote save’s IDs """
6
7 vote_obj = self.pool.get('idea.vote')
8+ comment_obj = self.pool.get('idea.comment')
9 vote = vote_obj.search(cr, uid, [('idea_id', '=', id), ('user_id', '=', uid)])
10 textual_value = str(field_value)
11-
12+ comment = comment_obj.read(cr, uid,id,['content'], context=context)
13+ if comment:
14+ vote_comment = comment['content']
15+ else:
16+ vote_comment =''
17 if vote:
18 if int(field_value) >= 0:
19- vote_obj.write(cr, uid, vote, {'score': textual_value })
20+ vote_obj.write(cr, uid, vote, {'score': textual_value ,'comment':vote_comment})
21 else:
22 vote_obj.unlink(cr, uid, vote)
23 else:
24 if int(field_value) >= 0:
25- vote_obj.create(cr, uid, {'idea_id': id, 'user_id': uid, 'score': textual_value })
26+ vote_obj.create(cr, uid, {'idea_id': id, 'user_id': uid, 'score': textual_value ,'comment':vote_comment})
27
28 _columns = {
29 'user_id': fields.many2one('res.users', 'Creator', required=True, readonly=True),