Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
1 Trả lời
2118 Lượt xem

Hi everyone, i just want to ask on how to hide the edit and create buttons on a form view depending on a condition in odoo 10. I made a two menus with the same model, and I want to hide the edit and create buttons on the form of the records in one of the menus. Thank you very much. Hoping for your response. 

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

Hi

You can create record rules, and add the condition inside the Domain 

Please try like this example 


<record id="portal_sale_order_user_rule" model="ir.rule">
<field name="name">Portal Personal Quotations/Sales Orders</field>
<field name="model_id" ref="sale.model_sale_order"/>
<field name="domain_force">[('message_partner_ids','child_of',[user.commercial_partner_id.id])]</field>
<field name="groups" eval="[(4, ref('base.group_portal'))]"/>
<field eval="0" name="perm_unlink"/>
<field eval="0" name="perm_write"/>
<field eval="1" name="perm_read"/>
<field eval="0" name="perm_create"/>
</record>

Hope this help

Regards

Ảnh đại diện
Huỷ bỏ
Tác giả

Thank you very much for this Bella James.

Bài viết liên quan Trả lời Lượt xem Hoạt động
2
thg 7 25
447
0
thg 12 24
1086
2
thg 10 24
1175
1
thg 8 24
2331
2
thg 7 24
1579