hello everyone, I want to hide the edit and create button on the form view for a specific user I use this code but the button not showing at all
i just want to hide buttons just for only group
<record model="ir.ui.view" id="edit_button_message">
<record model="ir.ui.view" id="edit_button_message_">
<field name="name">edit.button.message.1</field>
<field name="model">person.message</field>
<field name="inherit_id" ref="view_parent_message_form"/>
<field name="groups_id" eval="[(6,0,[ref('person_access')])]"/>
<field name="arch" type="xml">
<xpath expr="/form[@string='form_view_string']" position="attributes">
<attribute name="create">false</attribute>
<attribute name="edit">false</attribute>
</xpath>
</field>
</record>
and i use this
<form string="form_view_string" edit="false" create="false" >
nothing happened , I use odoo v8
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Kế toán
- Tồn kho
- PoS
- Project
- MRP
Câu hỏi này đã bị gắn cờ
Hi !
1. In your CSV File, You can control it by using below code. Here id must be unique and class name must be represented by model_sample_model( _name='sample.model').
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
access_rule_for_sample_model,give_your_name,model_sample_model,group_samples_manager,1,0,0,0
2. You can directly create ACL in Settings -> Technical -> Security -> Access Control List (Technical menu item not visible if you are not in debug mode.
3. Using fields_view_get method its also helpful to hide button based on user.
Hi , the above code sets the create and edit button invisible irrespective of the group.
you need to control it using ir_model_access.csv file,
include your object and specify the group and CRUD permission
You can refer any standard module for the syntax and usage
or you can achieve it with fields_view_get method
Bạn có hứng thú với cuộc thảo luận không? Đừng chỉ đọc, hãy tham gia nhé!
Tạo tài khoản ngay hôm nay để tận hưởng các tính năng độc đáo và tham gia cộng đồng tuyệt vời của chúng tôi!
Đăng kýBài viết liên quan | Trả lời | Lượt xem | Hoạt động | |
---|---|---|---|---|
|
0
thg 3 25
|
922 | ||
|
0
thg 1 25
|
3041 | ||
|
1
thg 8 23
|
14174 | ||
change password
Đã xử lý
|
|
1
thg 8 23
|
12873 | |
|
1
thg 7 23
|
9943 |