コンテンツへスキップ
メニュー
この質問にフラグが付けられました
1 返信
20188 ビュー

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 .

関連投稿 返信 ビュー 活動
2
10月 22
4721
0
1月 25
784
2
7月 23
3806
2
11月 22
7028
5
1月 24
13596