Odoo Help


attr invisible Workflow button

Shaumyadeep Chaudhuri
on 7/2/13, 10:54 AM 2,953 views

I'm using a OpenERP V7. I want to make a button invisible when it is not a specific user how can i do this? I'm trying to wrap the buttons in a group and assign attr invisible to it, so far it has not worked for me.

<group attrs="{'invisible' : [('req_department.manager_id.id','!=',user.id)]}">
                        <button name="department_change_accept_accepted" string="Accept" states="accepted" type="workflow" groups="base.group_hr_manager"/>
                        <button name="department_change_reject_accepted" string="Reject" states="accepted" type="workflow" groups="base.group_hr_manager"/>

Sudhir Arya (ERP Harbor Consulting Services)

--Sudhir Arya (ERP Harbor Consulting Services)--
| 6 8 8
Ahmedabad, India
--Sudhir Arya (ERP Harbor Consulting Services)--

• Co-Founder & Co-Owner at ERP Harbor Consulting Services

• ERP Consultant / ERP Customization / TechnoFunctional Expert

• Sound knowledge in Python, Odoo (Open ERP), XML, PostgreSQL

• Domain knowledge of Sale Management, Purchase Management, Warehouse Management, Manufacturing, Multi Company Configuration & Management, HR Management, Medical Management, Construction Management, Education Management, Point of Sale, Third Party Integrations

• Positive attitude and quick Learner

• Good analytical skill, quick bug and issue tracing and find the solution

• Good knowledge and experience in payment gateway integration with Odoo

• Ready to accept new challenges

• Active Memeber On Stackoverflow 




Sudhir Arya
ERP Harbor Consulting Services
Sudhir Arya (ERP Harbor Consulting Services)
On 7/5/13, 12:09 PM

What req_department is? I mean what is the type of this field? I guess req_department.manager_id.id doesn't work.

You may try this: [(manager_id,'=',user.id)] and remove states="accepted" from button.

Hope this will work.

Its a many2one field. I couldn't get it to work this way i used a functional field to get it to work by putting the cases in the method and returning True or False and checking for that.

Shaumyadeep Chaudhuri
on 7/9/13, 5:03 AM

About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

0 follower(s)


Asked: 7/2/13, 10:54 AM
Seen: 2953 times
Last updated: 3/16/15, 8:10 AM