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
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
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!
Sign upRelated Posts | Replies | Views | Activity | |
---|---|---|---|---|
|
1
मार्च 15
|
7231 | ||
|
1
जून 23
|
2325 | ||
|
3
मई 23
|
13233 | ||
|
1
अप्रैल 23
|
11399 | ||
|
1
जून 22
|
2676 |