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)
Creează-ți un cont astăzi pentru a beneficia de funcții exclusive și a interacționa cu minunata noastră comunitate!
Înscrie-te| Postări similare | Răspunsuri | Vizualizări | Activitate | |
|---|---|---|---|---|
|
1
mar. 15
|
8824 | |||
|
1
iun. 23
|
4075 | |||
|
3
mai 23
|
15359 | |||
|
1
apr. 23
|
13945 | |||
|
1
iun. 22
|
4639 |
1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.