Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
1 ตอบกลับ
6734 มุมมอง

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"/>
                        </group>
อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

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.

Related Posts ตอบกลับ มุมมอง กิจกรรม
4
ธ.ค. 23
38385
1
มี.ค. 15
4740
How do you change Create button? แก้ไขแล้ว
3
มิ.ย. 21
11261
1
ม.ค. 18
4830
[8.0] Is workflow really usefull ? แก้ไขแล้ว
4
ก.ค. 15
3869