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

I tried to add section_and_note_one2many widget in purchase order model. But the lines don't retain the sequence after saving.

I had to create a sequence record manually and write an onchange to increment the sequence. Which works perfectly.

But I see in the sale.order model there is nothing like separate sequence record or onchange. So I wonder how it works.

Thanks!

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

Make sure that:

* you define the _order in the comodel of section_and_note_one2many table. It should be something like:

 _order = "sequence,id"
* you apply the widget 'handle' in the tree view in the column sequence, e.g.:
<field name='section_and_note_one2many'>
    <tree>
        <field name='sequence' widget='handle'/>
        <!-- Other fields -->
    </tree>
</field>

No onchange, write, or inverse methods are required. The logic is behind the widget 'handle' and the related javascript. The '_order' is responsible for saving the order


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

Thanks! It worked. I think the id in _order is required. That's what I was missing.

Thanks! You saved my day .

Related Posts ตอบกลับ มุมมอง กิจกรรม
2
ต.ค. 22
4796
0
ม.ค. 25
853
2
ก.ค. 23
3895
2
พ.ย. 22
7080
5
ม.ค. 24
13705