summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorToufik Benjaa <tbe@odoo.com>2018-04-26 14:57:40 +0200
committerToufik Benjaa <tbe@odoo.com>2018-04-27 14:15:46 +0200
commitceeba05d70a6df217d4cc431fe726ae55811f8c3 (patch)
treebb8c54ef1f07d0e70796ded7efbd0be060b1465a
parent50f77ba091189bd785d459c042a6cec04a125fdb (diff)
[FIX] website_quote: Do not raise exception when quotation viewed
- When a quotation if viewed by a customer, a note is posted in the quotation's chatter saying "Quotation viewed by customer". This is causes issues if the quotation is accessed without the access token and by a partner that do not have the rights to write on the model "sale.order". To address this issue we provide to the "_message_post_helper" function the sale order's access token to bypass the accesses checks. OPW-1839183
-rw-r--r--addons/website_quote/controllers/main.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/addons/website_quote/controllers/main.py b/addons/website_quote/controllers/main.py
index 7b892f53fcc..bc5a3414414 100644
--- a/addons/website_quote/controllers/main.py
+++ b/addons/website_quote/controllers/main.py
@@ -50,7 +50,7 @@ class sale_quote(http.Controller):
if Order and request.session.get('view_quote_%s' % Order.id) != now and request.env.user.share:
request.session['view_quote_%s' % Order.id] = now
body = _('Quotation viewed by customer')
- _message_post_helper(res_model='sale.order', res_id=Order.id, message=body, token=token, message_type='notification', subtype="mail.mt_note", partner_ids=Order.user_id.sudo().partner_id.ids)
+ _message_post_helper(res_model='sale.order', res_id=Order.id, message=body, token=Order.access_token, message_type='notification', subtype="mail.mt_note", partner_ids=Order.user_id.sudo().partner_id.ids)
if not Order:
return request.render('website.404')