Skip to Content
Menu
Dette spørgsmål er blevet anmeldt
2 Besvarelser
11603 Visninger

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
Kassér
Bedste svar

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
Kassér
Forfatter

Thanks that worked for me

Bedste svar

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
Kassér
Related Posts Besvarelser Visninger Aktivitet
2
maj 25
2220
3
dec. 24
6377
1
jul. 24
3124
1
jun. 24
2169
2
jun. 24
3044