コンテンツへスキップ
メニュー
この質問にフラグが付けられました
3 返信
10819 ビュー

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


      

アバター
破棄
最善の回答

You have to use sorted function

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

...

アバター
破棄
著作者

Thanks Esther

最善の回答

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



アバター
破棄
関連投稿 返信 ビュー 活動
1
12月 18
3179
1
1月 18
6277
0
7月 17
5160
0
5月 17
2924
1
11月 23
9782