Created
May 12, 2022 08:42
-
-
Save sehrishnaz/2172a36372adf00943c157bbb552ace6 to your computer and use it in GitHub Desktop.
How to use and implement Percentpie 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_percentpie = fields.Integer(compute='_compute_progress_percentpie') | |
@api.depends('name','sequence') | |
def _compute_progress_percentpie(self): | |
for u in self: | |
if u.name and u.sequence: | |
progress = 100 | |
elif u.name: | |
progress = 50 | |
else: | |
progress = 0 | |
u.progress_percentpie = progress |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
How to use and implement Percentpie widget in Odoo