Skip ke Konten
Menu
Pertanyaan ini telah diberikan tanda
1 Balas
4576 Tampilan

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
Buang
Jawaban Terbai

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
Buang
Post Terkait Replies Tampilan Aktivitas
1
Mar 15
7011
1
Jun 23
2180
3
Mei 23
13140
1
Apr 23
11245
1
Jun 22
2499