Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
1 ตอบกลับ
1766 มุมมอง

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.

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

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

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
4
พ.ค. 16
7884
1
ส.ค. 20
3356
1
มิ.ย. 23
2148
2
เม.ย. 16
5280
0
ก.พ. 16
5223