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.

1

How to format Amount Paid on customer invoices

By
Iming Chan
on 7/29/15, 3:24 AM 1,031 views

Dear all,

I'm new to Odoo 8 and Qweb, so I'm looking for help to get my customer invoice report right.

On this report, there is an "Amount Paid" field:

<td><strong>Amount Paid</strong></td>

<td class="text-right">AUD$

<span t-raw="o.amount_total - o.residual"/>

When I print the report (in PDF), it shows detail as "AUD$13.5" instead of "AUD$13.50" (with 2 decimal places to be consistant with rest of this report).  On the screen, it does show with two (2) decimal places (which is consistant with Australian currency practice).

Can anyone help to get this corrected?

Thank you again for your help in advance.  Much appreciated.

Kind regards,

Iming

0
yannick yaskos
On 8/4/15, 10:49 PM

please i also have problem to interpred this code in my qweb report i new in  odoo v8 and i try to custum my quotation report


<tr class="border-black">

<td><strong>Total</strong></td>

<td class="text-right">

<span t-field="o.amount_total" t-field-options="{"widget": "monetary", "display_currency": "o.pricelist_id.currency_id"}"/>

</td>

</tr>

 

This isn't hard to understand: -

; new row with black border - Total; new column with bold text "Total" - ; another column with text right oriented - ; in upper cell that has text right oriented value of database column amount_total that is 'monetary' formated (with thousand and decimal characters and currency symbol at the end)
Matjaz
on 8/5/15, 2:51 AM
0
Matjaz
On 8/4/15, 7:02 AM

Hello,

I have the same problem in Odoo8 Qweb reporting.

Decimal Accuracy is set and it's working nicely if number in Qweb is defined as "t-field".

If you need to calculate or call function you need to do it with "t-esc" function and in that case number is not formatted correctly. As I saw, you can use "formalLang" but you have to wrap old RML parser with Qweb one as in "report_payslip".

But isn't this nonsense. We are throving away RML reporting in behalf of Qweb and now wrapping it again? What will happen in Odoo 9, will this solution work also (as I know there will be no support for RML)?

What can be done? Call a function and format a number on 'python' side ???


Thanks for any information or solution,

Matjaž

0
Juan Muñoz
On 7/29/15, 6:01 AM

Hi Iming,

In order to change the digits you must go to Settings/Technical/Database Structure/Decimal Accuracy and here can change all the fields digits.

In order to change the decimal or thousand separator, you must go to Settings/Translations/Languages, select your language and change the values.

Hope this will help you!

Regards, 

Juan.

0
Virali
On 7/29/15, 4:10 AM

Hii Iming Chan ,

May be this will help you. put this code instead yours.

<span t-raw="formatLang(o.amount_total - o.residual or 0, digits=2)"/> 

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: 7/29/15, 3:24 AM
Seen: 1031 times
Last updated: 8/4/15, 10:49 PM