Skip to Content
Meniu
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
Această întrebare a fost marcată
1 Răspunde
4718 Vizualizări

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

Imagine profil
Abandonează
Cel mai bun răspuns

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)
Imagine profil
Abandonează
Related Posts Răspunsuri Vizualizări Activitate
1
mar. 15
7235
1
iun. 23
2326
3
mai 23
13241
1
apr. 23
11418
1
iun. 22
2684