# Add line separator per order on grouped invoice

**URL:** https://discuss.tryton.org/t/add-line-separator-per-order-on-grouped-invoice/4577
**Category:** User
**Created:** [August 31, 2021, 9:22am UTC](https://discuss.tryton.org/t/add-line-separator-per-order-on-grouped-invoice/4577 "2021-08-31T09:22:01Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![herrdeh](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/herrdeh/32/821_2.png) [@herrdeh](https://discuss.tryton.org/u/herrdeh)
#### Post date: [August 31, 2021, 9:22am UTC](https://discuss.tryton.org/t/add-line-separator-per-order-on-grouped-invoice/4577/1 "2021-08-31T09:22:01Z")

</div>

Yet another little polish for that issue:  
Now I get sales invoices nicely collected, thanks to sale invoice grouping module.

Could I configure my invoice template in a manner so it inserts a line above any single order saying “your order of date :” ? - Sure, can be done by hand - but hey, we’re lazy, aren’t we? (at least I am)

Cheers,  
Wolf

---

<div class="post-metadata">

### Author: ![ced](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/ced/32/1237_2.png) [@ced](https://discuss.tryton.org/u/ced)
#### Post date: [August 31, 2021, 9:26am UTC](https://discuss.tryton.org/t/add-line-separator-per-order-on-grouped-invoice/4577/2 "2021-08-31T09:26:26Z")

</div>

I guess you will have to loop over the lines grouped by origin and insert a line per origin.  
The [`groupby`](https://docs.python.org/3/library/itertools.html#itertools.groupby) is not available in the standard report context so you will have to [extend it](https://docs.tryton.org/projects/server/en/latest/topics/reports/index.html#topics-reports).

---

<div class="post-metadata">

### Author: ![herrdeh](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/herrdeh/32/821_2.png) [@herrdeh](https://discuss.tryton.org/u/herrdeh)
#### Post date: [September 6, 2021, 11:23am UTC](https://discuss.tryton.org/t/add-line-separator-per-order-on-grouped-invoice/4577/3 "2021-09-06T11:23:41Z")

</div>

Thank you for your thoughts.  
Unluckily, I didnt yet make any progress in the fine art of programming, so I cannot do that on my own. ):
