Purchase Order Line Deep Sort
This module was written to extend the functionality of purchase order and allow you to manage sort of lines.
You can set the default sort order for the current company or you can set sort order for a particular purchase order.
Section, subsection and note lines are not part of the sorting: they stay where you placed them, and the sorting criteria is only applied to the product lines inside each of the blocks they delimit.
auto_awesome What this module does
AI-generated from the code · Odoo 19.0Automatically sorts the product lines of a purchase order by a chosen criterion (name, product, reference, planned date, price or quantity), either ascending or descending. A default sort can be set for the whole company, and each order can override it.
This module adds automatic sorting of purchase order lines. On each purchase order you get two new fields in the 'Purchase Delivery & Invoice' area of the form: 'Sort Lines By' and 'Sort Direction'. The available criteria are: by name, by product name, by product reference, by planned date, by unit price and by quantity; the direction can be ascending or descending.
Sorting happens automatically whenever you create an order, add or change lines, or change the sort criteria or direction. Lines are renumbered so they appear in the chosen order on screen and in reports.
Section, subsection and note lines are not moved: they act as separators, and only the product lines inside each block are sorted. This keeps the structure of the order intact.
In the Purchase settings you can define a company-wide default sort criterion and direction. New purchase orders then start with those values, but you can still change them on each individual order. If you clear the sort criterion, the direction is automatically cleared too.
The module extends purchase.order, purchase.order.line, res.company and res.config.settings, and adds options to the purchase order form and to the Purchase configuration screen.
Depends on
Models and fields (4)
- res.company · extends an existing modeldefault_po_line_order (Line Order), default_po_line_direction (Sort Direction)
- purchase.order · extends an existing modelline_order (Sort Lines By), line_direction (Sort Direction)
- purchase.order.line · extends an existing model
- res.config.settings · extends an existing modelpo_line_order_default (Line Order), po_line_direction_default (Sort Direction)
Text generated by AI (DeepSeek) from reading the Odoo 19.0 code on GitHub; it may contain mistakes, so check the code before deciding. View the code on GitHub
Availability by version
Reviewed: 2026-11-03Confirmation status: 7 confirmed, 2 with no information of 9 versions.
Sources · Odoo 15.0
Confirmed on 2026-11-03 in branch 15.0 of OCA/purchase-workflow.
terminal Installation and usage
OCA documentation · Odoo 19.0Configuration
Source · Odoo 19.0- Sort criteria items can be defined with a dot notation. This means that you can define an order as follows: product_id.default_code.
Usage
Source · Odoo 19.0- Go to Purchase \> Settings \> Default Sort Criteria and select one.
- You must select sort direction too.
- Create a new purchase and add several lines.
- On saving purchase order you must see how the purchase lines are ordered with your selected sort order.
No verified information in OCA: Installation.
Installation instructions, the distribution package, dependencies and configuration steps are not shown because they have not yet been verified in the module documentation for any version.
Data imported from GitHub: this sheet reflects the latest catalog review, not a live lookup. Always check the module documentation and staging before installing in production.