Skip to Content
Menu
This question has been flagged
1 Reply
2549 Views

Report Preview

Code Preview

how i can sort out name ....
first Duty 

Second Expense 
Third  Services 

any help 


Avatar
Discard
Best Answer

Hi,

I have done something like this in python and it worked 

sale_rec = sale_rec.sorted(key=lambda sale: (sale.state == 'sale' and 2) or (sale.state == 'draft' and 1)  or 0)

The above code in python will sort the records as confirmed sale orders as first and then the quotations. I haven't tested the same yet inside the qweb, have a try and see.


Thanks

Avatar
Discard
Related Posts Replies Views Activity
2
Apr 23
6965
3
Sep 20
3270
2
Apr 20
4832
0
Aug 24
319
1
Dec 23
942