Hello all,
I'm in odoo 8.
I use this line in a report template to sort products by default code :
<t t-foreach="docs.sorted(key=lambda x: x.default_code)" t-as="product">
It works well, but products are sorted like this (product with first letter in lowercase at the end...) :
AA0001BB0001
WW0009
aa0002
bb0001
But I would want products sorted like this instead :
AA0001aa0002
BB0001
bb0001
WW0009
or like this :
AA0001
aa0002
bb0001
BB0001
WW0009
Thanks to help!
EDIT #1
I have tried many ways to include the lower() function in my qweb line, no success. How should I use the lower() function?
For example :
<t t-foreach="docs.sorted(key=lambda x: (x.default_code).lower())" t-as="product">
<t t-foreach="docs.sorted(key=lambda x: x.default_code.lower)" t-as="product">
<t t-foreach="docs.sorted(key=lambda x: lower(x.default_code))" t-as="product">
<t t-foreach="docs.sorted(key=lambda x: x.default_code.lower())" t-as="product">
etc...