diff --git a/setup/web_widget_progressbar_color/odoo/addons/web_widget_progressbar_color b/setup/web_widget_progressbar_color/odoo/addons/web_widget_progressbar_color new file mode 120000 index 000000000000..b9ab7eee6a30 --- /dev/null +++ b/setup/web_widget_progressbar_color/odoo/addons/web_widget_progressbar_color @@ -0,0 +1 @@ +../../../../web_widget_progressbar_color \ No newline at end of file diff --git a/setup/web_widget_progressbar_color/setup.py b/setup/web_widget_progressbar_color/setup.py new file mode 100644 index 000000000000..28c57bb64031 --- /dev/null +++ b/setup/web_widget_progressbar_color/setup.py @@ -0,0 +1,6 @@ +import setuptools + +setuptools.setup( + setup_requires=['setuptools-odoo'], + odoo_addon=True, +) diff --git a/web_widget_progressbar_color/README.rst b/web_widget_progressbar_color/README.rst new file mode 100644 index 000000000000..f6fbbda46119 --- /dev/null +++ b/web_widget_progressbar_color/README.rst @@ -0,0 +1,102 @@ +============================ +Web Widget Progressbar Color +============================ + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:52cefe47def0fe37ee1abf6e7e2e7a7d91a660212b9e1729421d1bd15449af98 + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png + :target: https://odoo-community.org/page/development-status + :alt: Beta +.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png + :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html + :alt: License: AGPL-3 +.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fweb-lightgray.png?logo=github + :target: https://github.com/OCA/web/tree/16.0/web_widget_progressbar_color + :alt: OCA/web +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/web-16-0/web-16-0-web_widget_progressbar_color + :alt: Translate me on Weblate +.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png + :target: https://runboat.odoo-community.org/builds?repo=OCA/web&target_branch=16.0 + :alt: Try me on Runboat + +|badge1| |badge2| |badge3| |badge4| |badge5| + +This module allows to display progress bars with colorized bar. The +color will be green for values between 0% and 40%, yellow for values +between 40% and 70% and red between 70% and 100%. + +|Progressbar Color| + +.. |Progressbar Color| image:: https://raw.githubusercontent.com/OCA/web/16.0/web_widget_progressbar_color/static/description/progressbar_color.png + +**Table of contents** + +.. contents:: + :local: + +Usage +===== + +- When declaring a progressbar field, use the 'progressbar_color' + widget. + +Known issues / Roadmap +====================== + +- Be able to configure steps values for the three colors and also in + inversed mode. + +Bug Tracker +=========== + +Bugs are tracked on `GitHub Issues `_. +In case of trouble, please check there if your issue has already been reported. +If you spotted it first, help us to smash it by providing a detailed and welcomed +`feedback `_. + +Do not contact contributors directly about support or help with technical issues. + +Credits +======= + +Authors +------- + +* ACSONE SA/NV + +Contributors +------------ + +- Denis Roussel denis.roussel@acsone.eu + +Maintainers +----------- + +This module is maintained by the OCA. + +.. image:: https://odoo-community.org/logo.png + :alt: Odoo Community Association + :target: https://odoo-community.org + +OCA, or the Odoo Community Association, is a nonprofit organization whose +mission is to support the collaborative development of Odoo features and +promote its widespread use. + +.. |maintainer-rousseldenis| image:: https://github.com/rousseldenis.png?size=40px + :target: https://github.com/rousseldenis + :alt: rousseldenis + +Current `maintainer `__: + +|maintainer-rousseldenis| + +This module is part of the `OCA/web `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/web_widget_progressbar_color/__init__.py b/web_widget_progressbar_color/__init__.py new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/web_widget_progressbar_color/__manifest__.py b/web_widget_progressbar_color/__manifest__.py new file mode 100644 index 000000000000..37ca3e687fd5 --- /dev/null +++ b/web_widget_progressbar_color/__manifest__.py @@ -0,0 +1,20 @@ +# Copyright 2024 ACSONE SA/NV +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +{ + "name": "Web Widget Progressbar Color", + "summary": """This module allows to customize progressbar color""", + "version": "16.0.1.0.0", + "license": "AGPL-3", + "author": "ACSONE SA/NV,Odoo Community Association (OCA)", + "website": "https://github.com/OCA/web", + "maintainers": ["rousseldenis"], + "depends": ["web"], + "assets": { + "web.assets_backend": [ + "web_widget_progressbar_color/static/src/scss/progressbar.scss", + "web_widget_progressbar_color/static/src/xml/progressbar.xml", + "web_widget_progressbar_color/static/src/js/progressbar.esm.js", + ], + }, +} diff --git a/web_widget_progressbar_color/readme/CONTRIBUTORS.md b/web_widget_progressbar_color/readme/CONTRIBUTORS.md new file mode 100644 index 000000000000..4e7e6847269e --- /dev/null +++ b/web_widget_progressbar_color/readme/CONTRIBUTORS.md @@ -0,0 +1 @@ +- Denis Roussel diff --git a/web_widget_progressbar_color/readme/DESCRIPTION.md b/web_widget_progressbar_color/readme/DESCRIPTION.md new file mode 100644 index 000000000000..de323aa4b648 --- /dev/null +++ b/web_widget_progressbar_color/readme/DESCRIPTION.md @@ -0,0 +1,5 @@ +This module allows to display progress bars with colorized bar. +The color will be green for values between 0% and 40%, yellow for values +between 40% and 70% and red between 70% and 100%. + +![Progressbar Color](../static/description/progressbar_color.png) diff --git a/web_widget_progressbar_color/readme/ROADMAP.md b/web_widget_progressbar_color/readme/ROADMAP.md new file mode 100644 index 000000000000..a0fecb913b13 --- /dev/null +++ b/web_widget_progressbar_color/readme/ROADMAP.md @@ -0,0 +1 @@ +- Be able to configure steps values for the three colors and also in inversed mode. diff --git a/web_widget_progressbar_color/readme/USAGE.md b/web_widget_progressbar_color/readme/USAGE.md new file mode 100644 index 000000000000..e81aa072c86d --- /dev/null +++ b/web_widget_progressbar_color/readme/USAGE.md @@ -0,0 +1 @@ +- When declaring a progressbar field, use the 'progressbar_color' widget. diff --git a/web_widget_progressbar_color/static/description/icon.png b/web_widget_progressbar_color/static/description/icon.png new file mode 100644 index 000000000000..3a0328b516c4 Binary files /dev/null and b/web_widget_progressbar_color/static/description/icon.png differ diff --git a/web_widget_progressbar_color/static/description/index.html b/web_widget_progressbar_color/static/description/index.html new file mode 100644 index 000000000000..ecda1afdfd10 --- /dev/null +++ b/web_widget_progressbar_color/static/description/index.html @@ -0,0 +1,444 @@ + + + + + +Web Widget Progressbar Color + + + +
+

Web Widget Progressbar Color

+ + +

Beta License: AGPL-3 OCA/web Translate me on Weblate Try me on Runboat

+

This module allows to display progress bars with colorized bar. The +color will be green for values between 0% and 40%, yellow for values +between 40% and 70% and red between 70% and 100%.

+

Progressbar Color

+

Table of contents

+ +
+

Usage

+
    +
  • When declaring a progressbar field, use the ‘progressbar_color’ +widget.
  • +
+
+
+

Known issues / Roadmap

+
    +
  • Be able to configure steps values for the three colors and also in +inversed mode.
  • +
+
+
+

Bug Tracker

+

Bugs are tracked on GitHub Issues. +In case of trouble, please check there if your issue has already been reported. +If you spotted it first, help us to smash it by providing a detailed and welcomed +feedback.

+

Do not contact contributors directly about support or help with technical issues.

+
+
+

Credits

+
+

Authors

+
    +
  • ACSONE SA/NV
  • +
+
+
+

Contributors

+ +
+
+

Maintainers

+

This module is maintained by the OCA.

+ +Odoo Community Association + +

OCA, or the Odoo Community Association, is a nonprofit organization whose +mission is to support the collaborative development of Odoo features and +promote its widespread use.

+

Current maintainer:

+

rousseldenis

+

This module is part of the OCA/web project on GitHub.

+

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

+
+
+
+ + diff --git a/web_widget_progressbar_color/static/description/progressbar_color.png b/web_widget_progressbar_color/static/description/progressbar_color.png new file mode 100644 index 000000000000..6a0318263bdc Binary files /dev/null and b/web_widget_progressbar_color/static/description/progressbar_color.png differ diff --git a/web_widget_progressbar_color/static/src/js/progressbar.esm.js b/web_widget_progressbar_color/static/src/js/progressbar.esm.js new file mode 100644 index 000000000000..9a7fbdb28faa --- /dev/null +++ b/web_widget_progressbar_color/static/src/js/progressbar.esm.js @@ -0,0 +1,11 @@ +/** @odoo-module **/ +import {ProgressBarField} from "@web/views/fields/progress_bar/progress_bar_field"; +import {registry} from "@web/core/registry"; + +export class ProgressBarFieldColor extends ProgressBarField { + setup() { + super.setup(); + } +} +ProgressBarFieldColor.template = "web_widget_progressbar_color.ProgressBarFieldColor"; +registry.category("fields").add("progressbar_color", ProgressBarFieldColor); diff --git a/web_widget_progressbar_color/static/src/scss/progressbar.scss b/web_widget_progressbar_color/static/src/scss/progressbar.scss new file mode 100644 index 000000000000..12f6a6657adb --- /dev/null +++ b/web_widget_progressbar_color/static/src/scss/progressbar.scss @@ -0,0 +1,12 @@ +.o_progressbar .o_progress .o_progress_danger { + background-color: #dc3545; + height: 100%; +} +.o_progressbar .o_progress .o_progress_warning { + background-color: #ffc107; + height: 100%; +} +.o_progressbar .o_progress .o_progress_success { + background-color: #198754; + height: 100%; +} diff --git a/web_widget_progressbar_color/static/src/xml/progressbar.xml b/web_widget_progressbar_color/static/src/xml/progressbar.xml new file mode 100644 index 000000000000..2a823276ae7f --- /dev/null +++ b/web_widget_progressbar_color/static/src/xml/progressbar.xml @@ -0,0 +1,20 @@ + + + + + + + + + +