[FIX] website_quote: tokenized link in portal

When a user has access to a quote (because he is follower) but he is not
in the same company than the customer, an access error can occur on the
the rendering of the partner field.

We use the tokenized link instead, which will read the SO as a superuser
to avoid this situation.

opw-691740
This commit is contained in:
Nicolas Martinelli
2016-11-02 08:43:02 +01:00
parent a699504536
commit a4c67f2b9e
@@ -692,7 +692,12 @@
<t t-foreach="quotations" t-as="quotation">
<tr>
<td>
<a t-attf-href="/quote/#{quotation.id}?#{keep_query()}"><t t-esc="quotation.name"/></a>
<t t-if="quotation.sudo().partner_id.commercial_partner_id != request.env.user.partner_id.commercial_partner_id and request.env.user.share">
<a t-attf-href="/quote/#{quotation.id}/#{quotation.access_token}?#{keep_query()}"><t t-esc="quotation.name"/></a>
</t>
<t t-if="not (quotation.sudo().partner_id.commercial_partner_id != request.env.user.partner_id.commercial_partner_id and request.env.user.share)">
<a t-attf-href="/quote/#{quotation.id}?#{keep_query()}"><t t-esc="quotation.name"/></a>
</t>
</td>
<td><span t-field="quotation.validity_date"/></td>
<td>