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

In Sales Order, when we add a product on order lines, how to lock description field? so only users on group can manage to edit that field.

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

Hi,

Just you need to inherit of order line view and need to mention group_id and then you can make the field read-only/editable.

<record model = "ir.ui.view" id = "view_product_form">


    <field name = "name"> sale.order.line </field>


    <field name="model">sale.order.line</field>


    <field name="inherit_id" ref="sale.view_order_line_tree"/>


    <field name = "groups_id" eval = "[(6, 0, [ref ('module_name.group_id')])]" />


    <field name = "arch" type = "xml">


        <xpath expr = "// field [@ name = 'name']" position = "attributes">


            <attribute name = "readonly"> 1 </attribute>


        </xpath>


    </field>


</record>


Regards

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
4
thg 5 16
8034
1
thg 8 20
3500
1
thg 6 23
2326
2
thg 4 16
5456
0
thg 2 16
5405