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

I'm trying to show the report lines orderred by two values, maturity_date and amount, how can i achieve it.

i'm doing

<tr t-foreach="o.line_ids.sorted(key=lambda b: b.ml_maturity_date )" t-as="line">

to order by maturity_date,

how can i add amount so it gets ordered first by maturity_date and those result also for amount.

Kind regards,


الصورة الرمزية
إهمال
أفضل إجابة

Try it:

<tr t-foreach="o.line_ids.sorted(key=lambda b: (b.ml_maturity_date, b.another_param))" t-as="line">

الصورة الرمزية
إهمال
الكاتب

Thanks, it works!

المنشورات ذات الصلة الردود أدوات العرض النشاط
4
مايو 23
10819
1
يناير 19
9799
0
أكتوبر 17
3602
0
نوفمبر 16
2873
0
أكتوبر 16
5124