Odoo Help


This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.


How to respect the currency format in the shop even with products who have variants?

Pascal Tremblay
on 11/6/16, 12:28 PM 162 views

Hello there,

We are on Odoo 8.

I knew that I had a problem with the currency format in some case on my webshop. This morning, I noticed something...

For all products without variant, the price is well formatted (with a comma) :

But as soon as a product has some variants, the price is NOT well formatted (with a dot instead of the comma...) :

Would you have some ideas to format all my prices correctly in all cases?

Thanks for your comments


I suspect a problem in the file openerp/addons/website_sale/static/src/js/website_sale.js. I think the javascript is used when a product has some variants.

May be something in this code :

// change price when they are variants    
    $('form.js_add_cart_json label', oe_website_sale).on('mouseup touchend', function (ev) {       
        var $label = $(this);
        var $price = $label.parents("form:first").find(".oe_price .oe_currency_value");
        if (!$price.data("price")) {           
            $price.data("price", parseFloat($price.text()));
        var value = $price.data("price") + parseFloat($label.find(".badge span").text() || 0);
        var dec = value % 1;
        $price.html(value + (dec < 0.01 ? ".00" : (dec < 1 ? "0" : "") ));


Ţhe same thing arrives in the cart. When the customer change the quantity of an ordered item with the - or + buttons, the item price loses his comma for a dot :

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)


Asked: 11/6/16, 12:28 PM
Seen: 162 times
Last updated: 11/7/16, 9:03 AM