Merge pull request #1001 from odoo-dev/master-fix-website_sale-double-price-chm

[FIX] website_sale: discount price is never hide
This commit is contained in:
Christophe Matthieu
2014-07-09 18:00:24 +02:00
4 changed files with 21 additions and 4 deletions
@@ -333,6 +333,14 @@ label.css_attribute_color.css_not_available {
max-height: 500px;
}
.oe_default_price {
display: none;
}
.discount .oe_default_price {
display: block;
}
/* ---- Publish managment and options ---- */
#products_grid .css_options {
display: none;
@@ -282,6 +282,11 @@ label.css_attribute_color.css_not_available
display: block
max-height: 500px
.oe_default_price
display: none
.discount .oe_default_price
display: block
/* ---- Publish managment and options ---- */
#products_grid .css_options
@@ -102,7 +102,11 @@ $('.oe_website_sale').each(function () {
if (_.isEqual(variant_ids[k][1], values)) {
$price.html(price_to_str(variant_ids[k][2]));
$default_price.html(price_to_str(variant_ids[k][3]));
$default_price.parent().toggle(variant_ids[k][3]-variant_ids[k][2]>0.2);
if (variant_ids[k][3]-variant_ids[k][2]>0.2) {
$default_price.closest('.oe_website_sale').addClass("discount");
} else {
$default_price.closest('.oe_website_sale').removeClass("discount");
}
product_id = variant_ids[k][0];
break;
}
+3 -3
View File
@@ -371,7 +371,7 @@
</div>
</section>
<section class="container oe_website_sale" id="product_detail">
<section t-attf-class="container oe_website_sale #{(compute_currency(product.lst_price) - product.price) &gt; 0.1 and 'discount'}" id="product_detail">
<div class="row">
<div class="col-sm-7 col-md-7 col-lg-7">
<span itemprop="image" t-field="product.image" t-field-options='{"widget": "image", "class": "product_detail_img"}'/>
@@ -435,13 +435,13 @@
<template id="product_price">
<div itemprop="offers" itemscope="itemscope" itemtype="http://schema.org/Offer" class="product_price mt16">
<h4 class="oe_price_h4 css_editable_mode_hidden">
<span class="text-danger oe_default_price" t-att-style="'' if (compute_currency(product.lst_price) - product.price) &gt; 0.1 else 'display: none;'" style="text-decoration: line-through; white-space: nowrap;"
<span class="text-danger oe_default_price" style="text-decoration: line-through; white-space: nowrap;"
t-field="product.lst_price"
t-field-options='{
"widget": "monetary",
"from_currency": "website.currency_id",
"display_currency": "user_id.partner_id.property_product_pricelist.currency_id"
}'/><br/>
}'/>
<b class="oe_price" style="white-space: nowrap;"
t-field="product.price"
t-field-options='{