[FIX] website_sale: partial revert of 6b87284f

This commit has been forward-ported by error in 9 and +.
Update website_sale.js to fix impacted databases.

Decimal precision in v8 = 0.01, and v9+ = 2

With fwd port, int(0.01) instead of int(2) because data-precision
appears 2x, first with 0.01 (v8), secondly with 2 (v9+).

Js fix uses the last decimal-precision (v9) instead of the first (v8)
This commit is contained in:
Jeremy Kersten
2017-01-23 09:52:47 +01:00
parent 49f5aef548
commit a307ab8076
2 changed files with 2 additions and 3 deletions
@@ -255,7 +255,7 @@ $('.oe_website_sale').each(function () {
var precision = 2;
if ($(".decimal_precision").length) {
precision = parseInt($(".decimal_precision").first().data('precision'));
precision = parseInt($(".decimal_precision").last().data('precision'));
}
var formatted = _.str.sprintf('%.' + precision + 'f', price).split('.');
formatted[0] = utils.insert_thousand_seps(formatted[0]);
+1 -2
View File
@@ -417,8 +417,7 @@
<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 decimal_precision"
t-att-data-precision="user_id.partner_id.property_product_pricelist.currency_id.rounding">
<h4 class="oe_price_h4 css_editable_mode_hidden">
<span class="text-danger oe_default_price" style="text-decoration: line-through; white-space: nowrap;"
t-field="product.lst_price"
t-field-options='{