Post by pascdese »

Hello,

would it be possible to fill in 100% in the field of the Gantt view once the task is considered completed?

Thank you in advance


Post by nivl »

Hi pascdese,

There is a task for this currently in our pipeline that's due to be picked up. I will let you know when this is available.

Niels


Post by pascdese »

Great thanks in advance


Post by caalb »

I implemented what you asked for already in an additional module.
It sets the values vice versa. 100% -> done and done -> 100%.

# -*- coding: utf-8 -*-

from odoo import models, fields, api

class bryntumDone(models.Model):
    _inherit = 'project.task'

# set percent_done to 100 if state changes to done and vice versa
def write(self,vals):
    if 'state' in vals and vals['state'] == '1_done':
        vals['percent_done'] = 100
    if 'percent_done' in vals and vals['percent_done'] == 100:
        vals['state'] = '1_done'

    result = super(MODULENAME, self).write(vals)
    return result 

Post Reply