Give access to edit a field in form view
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ờ
2
Trả lời
7776
Lượt xem
Give access to edit a field in form view
Hi,
In your xml file view use the below group,
< field name="your_field" groups="base.group_no_one" />
In this case , the field will be visible only in debug mode (developer mode)
or use groups="base.group_system", This group is for admin rights.
Thanks
Thank you,it worked
You can use this code
Manager admin
Picking Type restriction
sorry,i didn't understand
1- create a new group for example (Manager admin):
<record id="admin_manager_group" model="res.groups">
<field name="name">Manager admin</field>
<field name="users" eval="[(6,0,[ref('base.user_admin')])]"/>
</record>
2- create a rule for (Manager admin):
<record id="picking_type_restriction" model="ir.rule">
<field name="name">Picking Type restriction</field>
<field name="model_id" ref="stock.model_stock_picking_type"/>
<field name="perm_create" eval="1"/>
<field name="perm_read" eval="1"/>
<field name="perm_write" eval="1"/>
<field name="perm_unlink" eval="1"/>
<field name="groups" eval="[(6,0,ref('your_module.admin_manager_group')])]"/>
</record>
OR you can use this code too (this make readonly standard_price fields in the product.template form , for the group commercial_group):
<record model="ir.ui.view" id="product_template_view_inherited">
<field name="model">product.template</field>
<field name="inherit_id" ref="product.product_template_only_form_view" />
<field name="groups_id" eval="[(6, 0, [ref('your_module.commercial_group')])]" />
<field name="arch" type="xml">
<xpath expr="//form/sheet/notebook/page[@name='general_information']/group/group[@name='group_standard_price']/div[@name='standard_price_uom']/field[@name='standard_price']" position="attributes">
<attribute name="attrs">{'readonly': 1}</attribute>
</xpath>
</field>
</record>
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 | |
---|---|---|---|---|
|
1
thg 9 22
|
7489 | ||
|
2
thg 11 23
|
3413 | ||
|
2
thg 12 23
|
12746 | ||
|
3
thg 7 22
|
23124 | ||
|
2
thg 6 21
|
18572 |
Maitre an tsy azoko fa mba azavao azafady