[FIX] website_sale_option: force price for qty 1

Display the price for 1 product only
This commit is contained in:
Jeremy Kersten
2016-09-21 21:29:18 +02:00
parent 7cd95c7b3f
commit fe46f2c7fd
2 changed files with 3 additions and 1 deletions
+2
View File
@@ -128,6 +128,8 @@ class WebsiteSale(http.Controller):
(variant id, [visible attribute ids], variant price, variant sale price)
"""
# product attributes with at least two choices
product = product.with_context(quantity=1)
visible_attrs_ids = product.attribute_line_ids.filtered(lambda l: len(l.value_ids) > 1).mapped('attribute_id').ids
to_currency = request.website.get_current_pricelist().currency_id
attribute_value_ids = []
@@ -63,7 +63,7 @@
}'/>
<span class="oe_price" style="white-space: nowrap;"
t-att-data-product-id="product.id"
t-field="product.price"
t-field="product.with_context(quantity=1).website_price"
t-options='{
"widget": "monetary",
"display_currency": website.currency_id