[IMP] pass subtype when creting question or answer.

bzr revid: tpa@tinyerp.com-20140324063601-mqsfc9jjfho14xot
This commit is contained in:
Turkesh Patel (Open ERP) 2014-03-24 12:06:01 +05:30
parent 546ad55636
commit 24b1b1fc81
1 changed files with 1 additions and 2 deletions

View File

@ -197,8 +197,7 @@ class Post(osv.Model):
#add 2 karma to user when asks question.
self.pool.get('res.users').write(cr, uid, [vals.get('user_id')], {'karma': 2}, context=context)
post_id = super(Post, self).create(cr, uid, vals, context=create_context)
#Note: just have to pass subtype in message post: gives error on installation time
self.message_post(cr, uid, [post_id], body=_(body), context=context)
self.message_post(cr, uid, [post_id], body=_(body), subtype=subtype, context=context)
return post_id
def write(self, cr, uid, ids, vals, context=None):