Help

Welcome!

This community is for professionals and enthusiasts of our products and services.
Share and discuss the best content and new marketing ideas, build your professional profile and become a better marketer together.

0

Format product price in Qweb

Avatar
Captcha

Hello,

My product price has 10 decimal digits but I want it get printed with 2 digits only (when printing invoices, quotations).
Could you please help?

Avatar
Discard
1 Answer
0
Avatar
David Tran
Best Answer

Firstly you must find the corresponding QWeb templates for invoice and quotation/sale order within Settings > Technical > User Interface > Views.
QWeb template for Quotation / Sales Order is report_saleorder_document
QWeb template for Invoice is report_invoice_document

Now, within report_saleorder_document's Architecture tab, find

<span t-field="l.price_unit"/>

And replace with
<span t-field="l.price_unit" t-field-options='{"widget": "monetary", "display_currency": "o.currency_id"}'/>


Within report_invoice_document's Architecture tab, find
<span t-field="l.price_unit"/>

And replace with
<span t-field="l.price_unit" t-field-options='{"widget": "monetary", "display_currency": "o.currency_id"}'/>


You are done now. Is that just simple, right?
Avatar
Discard

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!