跳至內容
選單
此問題已被標幟
1 回覆
1773 瀏覽次數

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

頭像
捨棄
相關帖文 回覆 瀏覽次數 活動
4
5月 16
7892
1
8月 20
3362
1
6月 23
2151
2
4月 16
5283
0
2月 16
5233