Community: Framework mailing list archives

expert-framework@mail.odoo.com

Order of one2many relation entries

by
Wolfgang Pichler
- 11/10/2014 08:37:40
Hi all,

i am wondering if there is an easy way to define the order of one2many relation entries in the column definition…

For example

'order_line': fields.one2many('sale.order.line', 'order_id', 'Order Lines', readonly=True, states={'draft': [('readonly', False)], 'sent': [('readonly', False)]}),

Order Lines in sale_order - lets say i want them to get ordered by unit_price

'order_line': fields.one2many('sale.order.line', 'order_id', 'Order Lines', readonly=True, states={'draft': [('readonly', False)], 'sent': [('readonly', False)]}, order=[(‚unit_price‘,’ASC']),

Is this already implemented ?

br,
Wolfgang