Odoo 도움말

0

0
4 응답
0
Avatar

Atul Patel (atp)

--Atul Patel (atp)--

5815
| 1 2 2
--Atul Patel (atp)--


Atul Patel (atp)
19. 7. 28. 오전 6:23

Hello,

Have you tried like this way in report qweb template :

https://github.com/odoo/odoo/blob/4909e87cd463c3bedcf096e0535ec90d829aa491/addons/stock/report/report_stockpicking_operations.xml#L91

for example : 

o.move_ids_without_package.sorted(key=lambda m: m.product_id.id)" t-as="move" that will sort move lines by product id.

You can use like that way to sort record by pass that field as key on lambda..

Thanks 


0
Yeison X. 콜롬비아
19. 7. 26. 오전 11:36

Hi Walled, 

Could you tell me where I can find (key=Nonereverse=False) parameter?

Thanks for your help.

1 코멘트
Waleed Mohsen Yemen
19. 7. 27. 오후 3:20

For example if you want to sort by product name and then by qty:

<tr t-foreach="lines.sorted(key=lambda p: (p.product_id.name, p.product_uom_qty))" t-as="move">

0
Avatar

Waleed Mohsen Yemen

--Waleed Mohsen--

3845
| 5 3 7
Sana'a, Yemen
--Waleed Mohsen--


Waleed Mohsen Yemen
19. 7. 26. 오전 10:26

You can use sorted(key=Nonereverse=False)

Parameters

  • key – either a function of one argument that returns a comparison key for each record, or a field name, or None, in which case records are ordered according the default model’s order
  • reverse – if True, return the result in reverse order



질문하기
Writer
Keep Informed
2 팔로워
About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

Register
Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now