跳至內容
選單
此問題已被標幟
2 回覆
11552 瀏覽次數

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
2218
3
12月 24
6354
1
7月 24
3116
1
6月 24
2165
2
6月 24
3033