Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
1 Odpovědět
4699 Zobrazení

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
Zrušit
Nejlepší odpověď

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
Zrušit
Related Posts Odpovědi Zobrazení Aktivita
1
bře 15
7222
1
čvn 23
2319
3
kvě 23
13221
1
dub 23
11393
1
čvn 22
2653