Перейти к содержимому
Меню
Чтобы взаимодействовать с сообществом, необходимо зарегистрироваться.
Этот вопрос был отмечен
3 Ответы
22746 Представления

Hi community!

I've been playing around with various formatting and widgets, but I cannot figure out a way to display a float (.3) as a percentage 3%.

Surely there must be a way to do this?

Thanks!

-Tim

Аватар
Отменить

In the web addon in the file web/static/src/js/view_form.js, you can see the list of all available form view widgets. The closest thing in that list would be the progressbar. The nicer but tougher alternative would be to write a module that extends the web interface to add a widget that displays floats as a percentage. Someone might have done that already but I have no idea.

Лучший ответ

I think this module (https://github.com/figol/percentage_widget ) would help you a lot.

Аватар
Отменить

doesn't work with odoo 8.0

Лучший ответ

Is't covered in Odoo v8 ???

Аватар
Отменить
Лучший ответ

You can use the progressbar widget it renders a progressbar with a percentage based on a float.

Do display 3% without a progressbar, you have to develop your own widget. (just a few lines of code)

Аватар
Отменить
Автор

Could you explain just a little more on how I could implement this with a few lines of code? I've done some extensive openerp module editing, but nothing with the web or js files. I basically understand that I pretty much need to copy the progressbar code, put this code in my custom module, and take out the portion that renders the bar. Could you point me in the right direction to get started?

Related Posts Ответы Просмотры Активность
0
авг. 18
4262
0
мар. 15
4643
5
мар. 20
12881
6
дек. 23
51744
1
июл. 24
2330