Skip ke Konten
Menu
Pertanyaan ini telah diberikan tanda
4 Replies
8757 Tampilan

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

Avatar
Buang
Jawaban Terbai

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)"/> 

Avatar
Buang
Jawaban Terbai

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>

 

Avatar
Buang

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)
Jawaban Terbai

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ž

Avatar
Buang
Jawaban Terbai

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.

Avatar
Buang
Post Terkait Replies Tampilan Aktivitas
1
Mar 21
3397
0
Jan 20
3739
5
Nov 16
11268
3
Jan 25
4833
0
Sep 24
1581