[FIX] improved code to add karma on vote

bzr revid: tpa@tinyerp.com-20140321094019-hbekr1rntbpdvvc5
This commit is contained in:
Turkesh Patel (Open ERP) 2014-03-21 15:10:19 +05:30
parent 283af4b6e5
commit 7738af32e2
1 changed files with 2 additions and 2 deletions

View File

@ -303,8 +303,8 @@ class Vote(osv.Model):
if record.vote == '1' or new_vote == '-1':
value = -10
elif record.vote == '-1' or new_vote == '1':
value = 10
self.pool['res.users'].write(cr, uid, [record.user_id.id], {'karma': value}, context=context)
value = 10
self.pool['res.users'].write(cr, uid, [record.post_id.user_id.id], {'karma': value}, context=context)
self.write(cr, uid, vote_ids, {
'vote': new_vote
}, context=context)