콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다
1 회신
7352 화면

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.

관련 게시물 답글 화면 활동
1
8월 25
4968
0
12월 24
9972
3
9월 24
22319
5
12월 24
53915
4
7월 24
11135