Created
May 12, 2022 08:41
-
-
Save sehrishnaz/e7f2ff50e7e531af9ab1a005b838d160 to your computer and use it in GitHub Desktop.
How to use and implement Gauge widget in Odoo
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class gym_body_parts_config(models.Model): | |
_name = 'gym.body.parts.config' | |
sequence = fields.Integer(default=10,help="Gives the sequence order when displaying a list of records.") | |
name = fields.Char(string="Name", required=True) | |
progress_gauge = fields.Integer(compute='_compute_progress_gauge') | |
@api.depends('name','sequence') | |
def _compute_progress_gauge(self): | |
for u in self: | |
if u.name and u.sequence: | |
progress = 100 | |
elif u.name: | |
progress = 50 | |
else: | |
progress = 0 | |
u.progress_gauge = progress |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
How to use and implement Gauge widget in Odoo