Ir al contenido
Menú
Se marcó esta pregunta
1 Responder
5093 Vistas

Hi, I created a custom Progress field (integer) for Project, how do I set this custom field to 100, whenever user change state to Closed or Done?

Thanks

Avatar
Descartar
Mejor respuesta

You can inherit the write method of that object, something like this:

class class_name(osv.osv):
    _inherit='object.name'
    def write(self, cr, uid, ids, vals, context=None):
        #Maybe some code here
        if vals.get('state'):
            if vals.get('state')=='done':
                #write your code here to write the percentage

    return super(class_name, self).write(cr, uid, ids, vals, context=context)
Avatar
Descartar
Publicaciones relacionadas Respuestas Vistas Actividad
1
mar 15
7565
1
jun 23
2699
3
may 23
13788
1
abr 23
11898
1
jun 22
3064