Sort lines by column again, section by section

Up to Odoo 18, a click on the Unit Price or Product header sorted the lines of an invoice, a quotation or a purchase order. Since Odoo 19, those headers no longer react. Sort Lines in Sections brings sorting back, inside each section: sections, subsections and subtotals stay where they are. Free, for Odoo 19 and 20.

  • Free
  • Odoo 19 · 20
  • Community & Enterprise
  • Odoo.sh

Column headers that no longer respond

Odoo 19 added subsections and section subtotals, computed from the position of the lines. A global sort would have mixed them up, so Odoo switched it off.

Dragging lines one by one

Putting the most expensive items first or grouping the lines of a quotation by product is done with the mouse, line after line.

Checking a long vendor bill

Without sorting by product or amount, finding one line among fifty means reading them all.

A global sort would be worse

Sorting the whole list would move lines from one section to another and break the subtotals.

What Sort Lines in Sections does

The click on the header, as before, without breaking the sections.

Sorted inside each section

A click on a header sorts the lines of each section, and of each subsection, on their own. Sections never move, so their subtotals stay right.

Click again to reverse

The arrow in the header shows the direction. Empty values always go last.

Notes and combos in place

Notes stay at the head of their section, combo items under their combo line.

Kept on save

The new order is the real order of the lines: saved with the document, in a single write, and printed on the PDF, as after a drag and drop.

Nothing on a locked document

A posted invoice or a locked order keeps its order: its headers are not sortable.

A natural sort

“Item 2” comes before “Item 10”, case and accent insensitive. Product, account or unit columns are sorted on the displayed name.

Odoo 19 invoice with two sections, lines sorted by unit price inside each section, sort arrow in the header
An invoice sorted by unit price: each section is sorted on its own, its subtotal does not move.

No settings

  1. Open a document

    Invoice, credit note, vendor bill, quotation, purchase order: any line list with sections. Lines not saved yet are sorted too.

  2. Click a header

    Product, description, quantity, unit price, subtotal: the lines are sorted inside each section; click again for the reverse order.

  3. Save

    The lines keep their new order, on screen and on the printed document. Nothing is written before you save; Discard brings the previous order back.

Frequently asked questions

Odoo 19 added subsections and section subtotals, computed from the position of the lines. A sort over the whole list would move lines from one section to another, so Odoo turned it off, and Odoo 20 did not bring it back. The module sorts section by section.
No. The lines are renumbered in the form only, like a drag and drop. Saving writes the new order in one go.
When the lines are spread over several pages, the first click loads all of them, in a single request: a section can start on one page and end on the next. All the lines are then shown on one page.
Yes. Drag and drop and the move buttons of the sections work as usual, before or after a sort.
Odoo 19 and 20, Community and Enterprise: it only depends on Invoicing (account).
No: Odoo Online does not accept third-party modules. It works on Odoo.sh and on your own server.

Another habit lost with Odoo 19?

Tell me which gesture no longer works: I tell you whether a setting or a module brings it back.