Odoo Help

Welcome!

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.

2

Number Format Qweb report

By
Javier Batres Velásquez
on 2/18/15, 9:58 AM 6,289 views

Hello I am trying to print the account.move model, and all is ok, but I need that the numbers appear like money "1,465.00", i can't show thtat with the to=housand separator and the 2 decimals.

Can someone help me and say me how.

This is the form that i am using for call the element: <t t-esc="line.credit" />

4

I have solved that. If someone help this:

      <t t-esc="'{0:,.2f}'.format(int(line.credit))" />

Could you please elaborate on what {0:,.2f}'.format(int(line.credit)) means?

E.M.
on 10/25/15, 7:02 AM

Good answer, work like a charm

mrpingu
on 11/30/15, 11:15 PM

Hi Javier Batres

Thanks for your answer is really helpful. Is there a way to change the type of the format you choose (instead of "," I want to use space " ". Instead of "." I want to use ",")

Othmane Ghandi (Usman BEK)
on 11/4/16, 7:22 AM
1
Khaled
On 10/18/15, 5:26 AM

you don't need to hard code your report with a specific format. so you can use the built in formats of odoo to support multi currency. as the following example

<t t-field="line.credit" t-field-options='{"widget": "monetary", "display_currency": "o.currency_id"}' />

also you need to check & make sure about the following settings that match your need

Settings -> Translations -> Languages -> 'your language settings'

seperator format should be something like [3,0]

for more info go to http://openerp-server.readthedocs.org/en/latest/06_ir_qweb.html

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)

Stats

Asked: 2/18/15, 9:58 AM
Seen: 6289 times
Last updated: 10/25/15, 7:01 AM