Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
1 ตอบกลับ
7179 มุมมอง

Hello,

I'm trying to display monetary fields like this : '525200.52' => '525 000,52' in form views

I understood that I have to modify the following file addons/web/static/src/js/view_forms.js . And I allready managed to display the correct value modifying the 'format_value' line 5483

return instance.web.format_value(val.toLocaleString('fr-FR'), {type: "string", digits: (this.node.attrs || {}).digits || this.field.digits}, def);

However, since the field is now a String, when I try to edit and save I get an error :

TypeError: a float is required

Which is normal.

I looked at the parse_value function but didn't manage to solve my issue...

What do I need to modify next to achieve my goal ?

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

you can see this link :http://help.openerp.com/question/88/how-to-define-the-thousands-separator/

อวตาร
ละทิ้ง
ผู้เขียน

Perfect, just what I needed ! Thank you.

Related Posts ตอบกลับ มุมมอง กิจกรรม
1
ส.ค. 25
4593
0
ธ.ค. 24
9715
3
ก.ย. 24
22017
How to activate the Technical Features? แก้ไขแล้ว
5
ธ.ค. 24
53437
4
ก.ค. 24
10850