Odoo Help

1

1
5 Answers
7
Avatar

Yogesh

--Yogesh--

1059
| 5 3 10
Delhi, India
--Yogesh--

Nothing to say .... :)

Yogesh
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

--Zbik--
12143
| 7 6 9
Łódź, Poland
--Zbik--


Zbik
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
Erhuvwu Akpobaro
22.01.15, 11:24

Thanks guys , for the help both examples worked .

1 Comment
Zbik
22.01.15, 12:09

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

-1
Avatar

Kazim Mirza | Founder at TechUltra Solutions

--Kazim Mirza | Founder at TechUltra Solutions --
856
| 3 3 7
Ahmedabad, India
--Kazim Mirza | Founder at TechUltra Solutions --
 
Kazim Mirza | Founder at TechUltra Solutions
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

 

 

Ask a Question
Keep Informed
1 follower(s)
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 eLearning platform and experience all Odoo Apps through learning videos, use cases and quizzes.

Test it now