Skip to Content
Меню
Вам необхідно зареєструватися, щоб взаємодіяти зі спільнотою.
Це запитання позначене
2 Відповіді
11532 Переглядів

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.

Аватар
Відмінити
Related Posts Відповіді Переглядів Дія
2
трав. 25
2203
3
груд. 24
6320
1
лип. 24
3071
1
черв. 24
2144
2
черв. 24
3022