コンテンツへスキップ
メニュー
この質問にフラグが付けられました
1 返信
4526 ビュー

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

アバター
破棄
最善の回答

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)
アバター
破棄
関連投稿 返信 ビュー 活動
1
3月 15
6951
1
6月 23
2133
3
5月 23
13098
1
4月 23
11184
1
6月 22
2458