تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
3 الردود
10644 أدوات العرض

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
ديسمبر 18
2981
1
يناير 18
6012
0
يوليو 17
4873
0
مايو 17
2709
1
نوفمبر 23
9499