[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
This commit is contained in:
@@ -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')
|
||||
|
||||
|
||||
Reference in New Issue
Block a user