Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ

We would like to extend the sale order views with duplicate icons for each line item as well as complete sections.

We are currently extending the line items like this by extending the view sale.view_order_form:


xpath expr="/form/sheet/notebook/page[@name='order_lines']/field[@name='order_line']/tree" position="inside"

button name="action_duplicate_line" icon="fa-copy" type="object"


/xpath


(Apologies for not formatting correctly - it looks like Odoo does remove all tags here).

However, this only works for line items, not for sections. I am aware that they have a different display_type​, but how can we extend the view to add the duplicate icon to lines with the display_type=line_section​?

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

Hi,

You can try this code to extend the sale order line 

<xpath expr="//field[@name='order_line']/tree/field[@name='field_name']" position="after">
      <button name="action_duplicate_line" icon="fa-copy" type="object" string="Duplicate Line"}"/>
</xpath>


Hope it helps

Ảnh đại diện
Huỷ bỏ
Tác giả

Thanks for the reply. This does unfortunately not work, since the widget "section_and_text" does override it.

Bài viết liên quan Trả lời Lượt xem Hoạt động
1
thg 7 18
7575
1
thg 7 23
2638
2
thg 1 24
5591
0
thg 4 24
2648
0
thg 12 23
1909