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

I would like to remove the editable attribute from this view element <tree string="Sales Order Lines" editable="bottom"> in my custom module.

I do not want to replace the whole tree element for the sake of removing the attribute.

How can I remove the editable attribute from the element above?



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

please try this
<record id="view_order_line_form_editable_list" model="ir.ui.view">
<field name="name">sale.order.line.form.editable.list</field>
<field name="model">sale.order</field>
<field name="inherit_id" ref="sale.view_order_form"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='order_line']/tree" position="attributes">
<attribute name="editable"/>
</xpath>
</field>
</record>

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

@Ahmed Ababneh

You could do it like this:

<xpath expr="//form/field[@name='order_line']/tree" position="attributes">
    <attribute name="editable">top</attribute>
</xpath>


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

You can override fields_view_get method for that object. Get the 'arch' by calling super method and remove the "editable" attrs from tree view. You will have to use python lxml packages and use etree to convert the arch into xml. You will get lots of examples in odoo addons of overriding fields_view_get.

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
0
มิ.ย. 22
13
2
มิ.ย. 25
477
1
มี.ค. 25
1132
0
พ.ย. 24
1383
2
ก.ย. 24
4267