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)
Create an account today to enjoy exclusive features and engage with our awesome community!
Přihlásit se| Related Posts | Odpovědi | Zobrazení | Aktivita | |
|---|---|---|---|---|
|
1
bře 15
|
8841 | |||
|
1
čvn 23
|
4121 | |||
|
3
kvě 23
|
15387 | |||
|
1
dub 23
|
14021 | |||
|
1
čvn 22
|
4697 |
1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.