Odoo Hilfe

1

1
6 Antworten
7
Avatar

Yogesh Indien

--Yogesh--

1069
| 5 3 10
Delhi, Indien
--Yogesh--

Nothing to say .... :)

Yogesh Indien
21.08.15, 15:38

You can use python for format your decimal numbers. "t-esc" attribute in qweb allows you to write python code, eg:


<span t-esc="'%.2f'%(t.amount)"/></span> 

You can add some computation as well

<span t-esc="'%.2f'%(t.amount * 100)"/></span>



This will print value to exactly two decimal places


1
Avatar

Zbik Polen

--Zbik--
12433
| 7 6 9
Łódź, Polen
--Zbik--


Zbik Polen
22.01.15, 10:06

Try simmilar to (o.currency_id is mandatory):

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

0
Avatar

Ankit H Gandhi(AHG) Indien

--Ankit H Gandhi(AHG)--

1439
| 6 5 8
Baroda, Indien
--Ankit H Gandhi(AHG)--

Learning Python..

Ankit H Gandhi(AHG) Indien
08.10.19, 06:59

Hello 

You can take reference of below code

<span t-esc="sum(docs.mapped('amount'))" t-options='{"widget": "float", "precision": 2}'/>
Best Thanks,
Ankit H Gandhi.


0
Erhuvwu Akpobaro Vereinigtes Königreich
22.01.15, 11:24

Thanks guys , for the help both examples worked .

1 Kommentar
Zbik Polen
22.01.15, 12:09

If worked, you vote and/or accept good answer or answers.

-1
Avatar

Kazim Mirza | Founder at TechUltra Solutions Indien

--Kazim Mirza | Founder at TechUltra Solutions --
866
| 3 3 7
Ahmedabad, Indien
--Kazim Mirza | Founder at TechUltra Solutions --
 
Kazim Mirza | Founder at TechUltra Solutions Indien
22.01.15, 10:02

Hello Erhuvwu Akpobaro

You need to import 
import openerp.addons.decimal_precision as dp

 'rent':fields.char('Rent') should be  'rent':fields.float('Rent',digits_compute= dp.get_precision('Account')),

Thank You

 

 

Fragen Sie
Stichwörter
Keep Informed
1 Verfolger
About This Community

This platform 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.

Register
Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now