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

Hi

There is a many2many field which is viewing with many2many_tags widget . 

<field name="tag_ids" widget="many2many_tags" placeholder="Tags..." options="{'no_create_edit': True}"/>

In the tag_ids model I have regular 'sequence' field. If the many2many field has tree/list view I can manage the drag / movable option of the many2many table by using following:

<field name="tag_ids">
<tree create="false" delete="false">
  <field name="sequence" widget="handle"/>
  <field name="display_name"/>
</tree>
</field>


Is there any way to use widget='handle' with many2many_tags?

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

There is no way to do it without a huge customization due that it's not designed for that, also you can't do widget='handle'  and widget="many2many_tags" for the same field and there are no proccessing of node childs for widget many2many_tags and no way to specify which field will be used to handle the order for widget="handle"

so no, there is no way to get it with odoo default js widgets

อวตาร
ละทิ้ง
ผู้เขียน

Thanks. But that would be great if those tags could be moved.

I think that they should respect the order setted in another tree view using a field with widget="handle" as long as that field is the same used on model._order

ผู้เขียน

The problem is the tag names will be shown on the website. So, there can be 20tags to 100tags for each record. Sometimes it is needed to show which tags should be shown first and which later. So, from backend they need to be defined by adding/removing. That is why it would be great if there is drag option for many2many_tags.

Related Posts ตอบกลับ มุมมอง กิจกรรม
2
ต.ค. 21
4930
2
เม.ย. 23
29400
1
ก.พ. 24
1859
0
ก.ค. 24
2811
0
ก.ค. 22
60