Dear All
I have one field in xml. I want to make it in such a way that it can be edited by manager only if value of another field is true and user is manager. How to make both checking in doo11.
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
Dear All
I have one field in xml. I want to make it in such a way that it can be edited by manager only if value of another field is true and user is manager. How to make both checking in doo11.
You have to declare a functional field which is of boolean type. the function for this functional field will be compute a true or false value based on all the conditions of yours (eg : is manager, other field condition etc) . you will put this functional field in view and make it invisible. you can use methods in res,users table to determine if current user belongs to manager group user.has_group(group_ext_id)
you will then define attrs={'readonly': condition} for your field that you need to toggle edit capability. condition will be based on the above declared functional field.
okay thanks which decorator can be used to call the function
The decorator name @api.depends
okay
Create an account today to enjoy exclusive features and engage with our awesome community!
Sign up