Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
2 Trả lời
1649 Lượt xem

Hey, 

does anyone knows how to change a field display in certain view?

(I want to make any float field to show 3 digits after ',' in search view (when filter))

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

Correction: Search Views are not for showing data they are for input so you can input numbers with 3 digits in the search box ex. 3.123

And yes! you can do that by changing the digits from 2 digits to 3 in the product price if you are not a technical person and you just want to change the prices digits of your products.
 
After you activate the developer mode:
Go to Odoo Settings >Technical > Database Structure >  Decimal Accuracy.

But if you have a custom module with custom fields and you are a technical guy just update your float's field digits count. Here is code example :

your_field = fields.Float(digits=3)
Ảnh đại diện
Huỷ bỏ
Tác giả Câu trả lời hay nhất

Hi thx for answering however that's not what i meant.

in odoo search_view when grouping records, float field show 2 decimal accuracy i need to inherit base model to change the decimal accuracy to 3 (globally for all models) (it's harder that it looks)

do you have any idea how to do that?

Ảnh đại diện
Huỷ bỏ