تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
1 الرد
17923 أدوات العرض

Hi there,

I need to format output field, for example:
now it's display like this: 123,432,654.22
needed: 12343265422
or would be better: 1234-326-5422
How can i do it? I've read and trying do with class and widget. Maybe it's wrong way. I spent about 8 hours for this problem. Thank's for your answers.
number = fields.Float(string='Number', size=16, digits=(16, 0), required=True)

الصورة الرمزية
إهمال
أفضل إجابة

If you want to do it from configuration, you can do it from Settings / Language. Select your current language and set the thousand separator.


But this will change the behavior of all the float fields in the system.

If you just wish to do it for few fields, you can create a compute field of type char and using python logic, you can display the value as per your need.


الصورة الرمزية
إهمال
المنشورات ذات الصلة الردود أدوات العرض النشاط
2
أبريل 16
18098
0
سبتمبر 23
2526
2
سبتمبر 23
8465
0
يناير 23
1842
2
مارس 21
4420