Odoo Help

0
0
Thierry Godin
On 7/24/13, 5:01 AM

Hi , you can change decimal precision by going to :

Configuration / Technical / DB Structure/ Decimal precision

Best regards

Edit : You may take a look at point_of_sale/static/src/js/widget_base.js around line 20

build_currency_template: function(){

            if(this.pos && this.pos.get('currency')){
                this.currency = this.pos.get('currency');
            }else{
                this.currency = {symbol: '$', position: 'after', rounding: 0.01};
            }

            var decimals = Math.max(0,Math.ceil(Math.log(1.0 / this.currency.rounding) / Math.log(10)));

            this.format_currency = function(amount){
                if(typeof amount === 'number'){
                    amount = Math.round(amount*100)/100;
                    amount = amount.toFixed(decimals);
                }
                if(this.currency.position === 'after'){
                    return amount + ' ' + this.currency.symbol;
                }else{
                    return this.currency.symbol + ' ' + amount;
                }
            }

        },

You can change the decimal value here :

this.currency = {symbol: '$', position: 'after', rounding: 0.01};

format_currency() is the function called in pos.xml to display prices.

<t t-name="ProductWidget">
        <li class='product'>
            <a href="#">
                <div class="product-img">
                    <img src='' /> <!-- the product thumbnail -->
                    <t t-if="!widget.model.get('to_weight')">
                        <span class="price-tag">
                            <t t-esc="widget.format_currency(widget.model.get('price'))"/>   
                        </span>
                    </t>
                    <t t-if="widget.model.get('to_weight')">
                        <span class="price-tag">
                            <t t-esc="widget.format_currency(widget.model.get('price'))+'/Kg'"/>
                        </span>
                    </t>
                </div>
                <div class="product-name">
                    <t t-esc="widget.model.get('name')"/>
                </div>
            </a>
        </li>
    </t>

Maybe you have to reload OpenERP

I have changed the 'Product Price' digits to 4,but here inherit cost_price still is 2.

binfeng
on 7/24/13, 5:55 AM

Just for let you know that I have updated my answer.

Thierry Godin
on 7/25/13, 7:24 AM

Thank you very much! It is very hard to me.whatever I will try.

binfeng
on 7/25/13, 11:52 PM

About This Community

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

Question tools

0 follower(s)

Stats

Asked: 7/24/13, 4:45 AM
Seen: 8708 times
Last updated: 12/17/18, 10:21 PM