Somesh Khare(OpenERP) has proposed merging 
lp:~openerp-dev/openobject-addons/6.1-opw-574714-skh into 
lp:openobject-addons/6.1.

Requested reviews:
  Naresh(OpenERP) (nch-openerp)

For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-addons/6.1-opw-574714-skh/+merge/105446

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
-- 
https://code.launchpad.net/~openerp-dev/openobject-addons/6.1-opw-574714-skh/+merge/105446
Your team OpenERP R&D Team is subscribed to branch 
lp:~openerp-dev/openobject-addons/6.1-opw-574714-skh.
=== 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 @@
         @param ids: List of vote save’s IDs """
 
         vote_obj = self.pool.get('idea.vote')
+        comment_obj = self.pool.get('idea.comment')
         vote = vote_obj.search(cr, uid, [('idea_id', '=', id), ('user_id', '=', uid)])
         textual_value = str(field_value)
-
+        comment = comment_obj.read(cr, uid,id,['content'], context=context)
+        if comment:
+            vote_comment = comment['content']
+        else:
+            vote_comment =''
         if vote:
             if int(field_value) >= 0:
-                vote_obj.write(cr, uid, vote, {'score': textual_value })
+                vote_obj.write(cr, uid, vote, {'score': textual_value ,'comment':vote_comment})
             else:
                 vote_obj.unlink(cr, uid, vote)
         else:
             if int(field_value) >= 0:
-                vote_obj.create(cr, uid, {'idea_id': id, 'user_id': uid, 'score': textual_value })
+                vote_obj.create(cr, uid, {'idea_id': id, 'user_id': uid, 'score': textual_value ,'comment':vote_comment})
 
     _columns = {
         'user_id': fields.many2one('res.users', 'Creator', required=True, readonly=True),

_______________________________________________
Mailing list: https://launchpad.net/~openerp-dev-gtk
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~openerp-dev-gtk
More help   : https://help.launchpad.net/ListHelp

Reply via email to