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
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