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
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)
Özel özelliklerden yararlanmak ve harika topluluğumuzla etkileşime geçmek için bugün bir hesap oluşturun!
Üye Ol| İlgili Gönderiler | Cevaplar | Görünümler | Aktivite | |
|---|---|---|---|---|
|
1
Mar 15
|
8816 | |||
|
1
Haz 23
|
4059 | |||
|
3
May 23
|
15341 | |||
|
1
Nis 23
|
13913 | |||
|
1
Haz 22
|
4621 |
1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.