跳至內容
選單
此問題已被標幟
1 回覆
7343 瀏覽次數

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

頭像
捨棄
相關帖文 回覆 瀏覽次數 活動
0
3月 25
1443
0
1月 25
3576
1
8月 23
14931
1
8月 23
13596
1
7月 23
10576