From 6b87284f3f00527b10cb41477849079423c97211 Mon Sep 17 00:00:00 2001 From: Jeremy Kersten Date: Tue, 10 Jan 2017 21:29:52 +0100 Subject: [PATCH] [FIX] website_sale: fix amount format This commit fix wrong grouping when we format price via price_to_str. where '[3,0]' was interpreted as string and not array in intersperse. Thousand separator was duplicated ",,,320.00" e.g. This commit fix also product page where amount for variant was formatted js side before that RPC translation (website.ready() defered) was resolved. '/website/translations' is only called when user have rights to edit page. So a standard user didn't call it and l10n is not initialized. After an update, now we format the amount with the l10n value. To stay retro compatible, if l10n is not initialized (value = []) we use [] for grouping as 'fallback value'. To fix decimal precision you need to update the template product_price. To fix the grouping, you need to update the website.layout To fix the decimal separator, (and previous fix), you just need to pull the JS This commit is related to #1103, #11553, #14772, #14874, ... And fix the previous fix odoo/odoo@1f10ef8055f6c661fc6407a8ce4593dfc30452b4 It should also fix (by side-effect) the translation JS for user without editor right. Already fixed in V9 - don't forward this commit... --- addons/website/views/website_templates.xml | 2 +- .../website_sale/static/src/js/website_sale.js | 16 +++++++++------- addons/website_sale/views/templates.xml | 3 ++- 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/addons/website/views/website_templates.xml b/addons/website/views/website_templates.xml index f686e785dd6..539f1d05b95 100644 --- a/addons/website/views/website_templates.xml +++ b/addons/website/views/website_templates.xml @@ -56,7 +56,7 @@