Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
3 Risposte
11033 Visualizzazioni

For example, I have a custom sale order report.
Notes

description                     currency             Amount

basic computer             AED                  23500

Processor core              AED                 2100

Computer Case            AED                  25


i created the record in this order. But i want the records in 

description                     currency             Amount

computer case            AED                     25

Processor core              AED                   2100

Base Computer             AED                  23500


Notes

How to arrange the record in this order.Thanks in advance


      

Avatar
Abbandona
Risposta migliore

You have to use sorted function

.sorted(key=lambda a:(a.create_date))

...

Avatar
Abbandona
Autore

Thanks Esther

Risposta migliore

Following the Esther Martín steps:


<t t-set="tax_line_ids_sorted" t-value="o.tax_line_ids.sorted(key=lambda a:(a.tax_id.amount))"/>
<t t-foreach="tax_line_ids_sorted" t-as="tax_line">
     ...
</t> 


Jose Carlos Ramos Carmenates

Up3 Group



Avatar
Abbandona
Post correlati Risposte Visualizzazioni Attività
1
dic 18
3436
1
gen 18
6541
0
lug 17
5405
0
mag 17
3170
1
nov 23
10087