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

good morning

i am working on Odoo v8.0, and i want to :

- hide the edit button when a condition is verified

i tried the following code but it didn't worked :

attrs = "{'edit':[('request_state','=','draft')]}"
อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

hello,

Edit and Create button are managed by setting access rights using xml and csv.

To hide Edit set permission write to false.

    <record model="ir.rule" id="ir_values_my_costume_rule">
        <field name="name">My Rule Name</field>
        <field name="model_id" ref="model_your_model_name"/>
        <field name="domain_force">[('field','operator','value'),('user_id','=',user.id)]</field>
        <field name="perm_read" eval="True"/>
        <field name="perm_write" eval="False"/>
        <field name="perm_unlink" eval="True"/>
        <field name="perm_create" eval="True"/>
    </record>


for more details refer this link : https://www.odoo.com/forum/how-to/developers-13/setting-up-rules-access-right-in-xml-csv-files-12667

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
0
มี.ค. 25
1443
0
ม.ค. 25
3588
1
ส.ค. 23
14946
change password แก้ไขแล้ว
1
ส.ค. 23
13603
1
ก.ค. 23
10595