Sales invoice print format order items

hi experts
i am facing a problem in print format
i have 6 items in invoice three of them in item group and 2 in other group and the last have other group
i want to print these item accourding to thier groups by order and make the group name as an address for it’s group

Thanks in advance

@BOB you can create a custom print format . and change the order using jinja

any support with this ? i have already created custom print format but how to change the order with jinja code

Hi @BOB,

I am not sure but try it.

{% for row in items | sort(attribute='item_group') %}

More information for check its documentation and search it like dictsort
Maybe it’s helpful for you.

Thank You!

hi @Solufy
at first Thanks for your help
i tried this code and searched the document but i can’t acheave it
any other option ?