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
=== modified file 'idea/idea.py'
--- idea/idea.py 2011-12-31 07:57:20 +0000
+++ idea/idea.py 2012-05-11 07:26:18 +0000
@@ -160,17 +160,22 @@
160 @param ids: List of vote save’s IDs """160 @param ids: List of vote save’s IDs """
161161
162 vote_obj = self.pool.get('idea.vote')162 vote_obj = self.pool.get('idea.vote')
163 comment_obj = self.pool.get('idea.comment')
163 vote = vote_obj.search(cr, uid, [('idea_id', '=', id), ('user_id', '=', uid)])164 vote = vote_obj.search(cr, uid, [('idea_id', '=', id), ('user_id', '=', uid)])
164 textual_value = str(field_value)165 textual_value = str(field_value)
165166 comment = comment_obj.read(cr, uid,id,['content'], context=context)
167 if comment:
168 vote_comment = comment['content']
169 else:
170 vote_comment =''
166 if vote:171 if vote:
167 if int(field_value) >= 0:172 if int(field_value) >= 0:
168 vote_obj.write(cr, uid, vote, {'score': textual_value })173 vote_obj.write(cr, uid, vote, {'score': textual_value ,'comment':vote_comment})
169 else:174 else:
170 vote_obj.unlink(cr, uid, vote)175 vote_obj.unlink(cr, uid, vote)
171 else:176 else:
172 if int(field_value) >= 0:177 if int(field_value) >= 0:
173 vote_obj.create(cr, uid, {'idea_id': id, 'user_id': uid, 'score': textual_value })178 vote_obj.create(cr, uid, {'idea_id': id, 'user_id': uid, 'score': textual_value ,'comment':vote_comment})
174179
175 _columns = {180 _columns = {
176 'user_id': fields.many2one('res.users', 'Creator', required=True, readonly=True),181 'user_id': fields.many2one('res.users', 'Creator', required=True, readonly=True),