Skip to Content
Menu
This question has been flagged
1 Atsakyti
1779 Rodiniai

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.

Portretas
Atmesti
Best Answer

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

Portretas
Atmesti
Related Posts Replies Rodiniai Veikla
4
geg. 16
7895
1
rugp. 20
3382
1
birž. 23
2158
2
bal. 16
5291
0
vas. 16
5245