Skip to Content
Menú
This question has been flagged
2 Respostes
11479 Vistes

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

Avatar
Descartar
Best Answer

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.

Avatar
Descartar
Autor

Thanks that worked for me

Best Answer

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.

Avatar
Descartar
Related Posts Respostes Vistes Activitat
2
de maig 25
2087
3
de des. 24
6082
1
de jul. 24
2923
1
de juny 24
2063
2
de juny 24
2886