[FIX] website_sale: pop needs a default or it raises an exception

This commit is contained in:
Damien Bouvy
2015-08-31 21:56:18 +02:00
parent 37c62282a2
commit 1847cdf90e
@@ -14,7 +14,7 @@ class WebsiteMailController(WebsiteMail):
@http.route(['/website_mail/post/json'], type='json', auth='public', website=True)
def chatter_json(self, res_model='', res_id=None, message='', **kw):
params = kw.copy()
params.pop('rating')
params.pop('rating', False)
message_data = super(WebsiteMailController, self).chatter_json(res_model=res_model, res_id=res_id, message=message, **params)
if message_data and kw.get('rating') and res_model == 'product.template': # restrict rating only for product template
rating = request.env['rating.rating'].create({