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

Hi,

How can i make a one2many field non clickable in odoo.Even though i didnt define any form view for the one2many filed it raises a form when click on the field after saving.Any solution for this.

Thanks

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

Hi,

You can disable the form view of that one2many field by defining  style="pointer-events:none;".
For example you can refer the following code

<field name="line_ids"  style="pointer-events:none;">
<tree string="Lines" editable="bottom">
<field name="serial_no"/>
<field name="name"/>
<field name="category_id"/>
<field name="child_id"/>
</tree>
</field>

But after using this option you cant edit the field.

Refer https://stackoverflow.com/questions/51321569/how-to-restrict-disable-the-form-view-while-click-tree-view-of-one2many-field-i

Thanks

Ảnh đại diện
Huỷ bỏ

How can it be editable having non-clickable?

@Kamrul: that's something contradictory, shouldn't be as like that