[FIX] website_sale_options: public user can't add item to cart

Before this commit, clicking on add to cart as a public user* would throw an
error because it would access uom.name on which public user has no right.
*From the product page (/shop/product/xxx) having an optional product, the
access error is really on the optional product.

Now, we allow user to read name with sudo().
This commit is contained in:
rde
2017-10-12 16:20:42 +02:00
committed by Jeremy Kersten
parent c400789d6e
commit cd6c898643
@@ -121,7 +121,7 @@
<input type="hidden" class="js_optional_same_quantity" t-attf-name="optional-add-#{product_index}" value="0"/>
<a href="#" class="js_add btn btn-sm btn-info"><strong>Add<span class='hidden-xs'> to Cart</span></strong></a>
<span class="js_remove hidden">
<span class="js_item">1 </span><span class="js_items hidden">5 </span> <span t-field="product.uom_id.name"/><br/>
<span class="js_item">1 </span><span class="js_items hidden">5 </span> <span t-field="product.uom_id.sudo().name"/><br/>
<a href="#" class="js_remove btn btn-xs btn-info"><small>Remove <span class='hidden-xs'> from Cart</span></small></a>
</span>
</div>