How to Create a Progress Bar in Odoo 17 - Odoo 17 Slides

CelineGeorge1 1,303 views 12 slides Sep 17, 2024
Slide 1
Slide 1 of 12
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12

About This Presentation

This slide will show how to create a progress bar in Odoo 17. Odoo offers a wide variety of field widgets, such as radio buttons, floats, percentages, color selectors, checkboxes, status bars, and URLs. By using different rendering templates, we can modify the view with the widget.


Slide Content

How to Create a Progress Bar in Odoo 17 Enterprise

Introduction Enterpr ise This slide will show how to create a progress bar in Odoo 17. Odoo offers a wide variety of field widgets, such as radio buttons, floats, percentages, color selectors, checkboxes, status bars, and URLs. By using different rendering templates, we can modify the view with the widget.

Enterprise Let’s create a new template named “ProgressBarWidget” in the XML file.

Enterprise Progress_number and progress-bar-inner are two classes. The class ‘progress-bar-inner’ defines the style of the progress bar. The class ‘progress_number’ shows the percentage of progress.

Enterprise We need to set the background color and height of the progress bar. Let’s create a css file for the progress bar widget. z

Enterprise z

Enterprise Let’s create a js file for the progress bar widget. z

Enterprise Using useRef to establish a reference to the root element, it initializes the component and attaches event handlers through the use of ‘onMounted’ and ‘onPatched’ . The progress bar is updated by the ‘onUpdateProgressBar’ method using the value that is given in the props. It updates the corresponding elements in the DOM and determines the width of the progress bar. And add the supported types, templates, and props to the progress bar. The ProgressBarWidget supports the following field types: Float and integer Enter ‘progress_bar_widget’ in the ‘fields’ category of the Odoo registry to register the ProgressBarWidget.

Enterprise Let’s add the widget on the field progress in the model sale order. Run the pycharm and upgrade the module.

Enterprise Open the sale order tree view and here we can view the progress bar that we have created .

Enterprise This is how we can create a progress bar in Odoo 17.

For More Info. Check our company website for related blogs and Odoo book. Check our YouTube channel for functional and technical videos in Odoo. Enterprise www.cybrosys.com