Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

1

Display number as percentage

By
tim diamond
on 10/25/13, 6:52 PM 4,572 views

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.

Brett Lehrer
on 10/26/13, 5:07 AM
0
Walid Redwan
On 1/15/15, 9:41 AM

Is't covered in Odoo v8 ???

0

Fabien Pinckaers (fp)

--Fabien Pinckaers (fp)--
6598
| 6 8 8
fsdsdfsdf, Belgium
--Fabien Pinckaers (fp)--

Odoo Founder & CEO

Fabien Pinckaers (fp)
On 10/26/13, 6:45 AM

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?

tim diamond
on 10/28/13, 8:17 PM
0
figol
On 9/12/14, 12:20 AM

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

doesn't work with odoo 8.0

Qamar Soft
on 7/19/16, 10:49 AM

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

0 follower(s)

Stats

Asked: 10/25/13, 6:52 PM
Seen: 4572 times
Last updated: 3/16/15, 8:10 AM