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

Hi

I have a problem that when i input order line in a certian order. After i save that order the order of the lines isn't the same anymore. is there a way to solve this or is this just the way openerp orders the order lines.

Kind regards

アバター
破棄
最善の回答

Hi,

in 'sale.order.line' :

_order = 'order_id desc, sequence'
_defaults = {      
            'sequence': 10,
            }

Sequence : Gives the sequence order when displaying a list of sales order lines.

so all order lines have a sequence=10.

to keep order of the input lines change _order by;

--  _order = 'order_id desc, sequence'
++  _order = 'id'

you can change it in sale.py but this is not the best way must create a new module to overwrite _order.

アバター
破棄
著作者

Thanks that worked for me

最善の回答

the easier way would be to make a change in the form view of sale order or invoice. on the line field name = sequence: replace <field name="sequence" widget="handle"/> with just <field name="sequence"/> Done.

アバター
破棄
関連投稿 返信 ビュー 活動
2
5月 25
2186
3
12月 24
6268
1
7月 24
3049
1
6月 24
2126
2
6月 24
3001