OdooWiki OCA HUB

Purchase Order Line Merge

purchase_order_line_merge folder_open OCA/purchase-workflow open_in_new
Inventory/Purchase License: AGPL-3

This module allows users to select multiple purchase order lines from different purchase orders and merge them into a single new purchase order.

Unlike purchase_merge which works at the order level, this module operates at the line level, giving more granular control over which specific lines to consolidate.

Key features:

  • Lines with the same product, unit price, unit of measure, and taxes are automatically grouped into a single line on the resulting purchase order.
  • The default quantity to merge considers both invoiced and received amounts, defaulting to the available (uninvoiced/unreceived) quantity.
  • The unit price is editable in the wizard, allowing price adjustments before creating the new order.
  • Partial merges are supported: the remaining quantity stays on the original order.
  • Orders that reach zero amount after the merge are automatically cancelled.

This module also adds the Qty Invoiced and Qty Received columns to the Purchase Order Lines list view for better visibility.

auto_awesome What this module does

AI-generated from the code · Odoo 18.0

Lets purchasing users select several purchase order lines and combine them into one new purchase order, grouping identical lines together. Remaining quantities stay on the original orders, and emptied orders are cancelled automatically.

This module adds a wizard that merges selected purchase order lines into a single new purchase order. It is available from the purchase order lines list: select the lines you want and use the "Merge into Purchase Order" action.

The wizard shows the vendor, the order date and a table of the selected lines with their source purchase order, product, original quantity, quantity to merge, unit price, discount, taxes and subtotal. You can change the quantity to merge and the unit price before confirming, so partial merges are possible.

When you click "Merge Lines", the module checks that all selected lines share the same currency and the same warehouse; otherwise it stops with an error. Lines with the same product, unit price, unit of measure, taxes and discount are grouped into one line on the new order, and their quantities are added up. The new purchase order keeps the vendor and date you entered, and its origin field lists the source order names.

After merging, the remaining quantity is written back on each original line. Any source purchase order whose total becomes zero is cancelled automatically. Lines with a quantity of zero are ignored, and if nothing is left to merge the wizard shows an error.

Depends on

Models and fields (2)
  • purchase.order.line.merge · new modelline_ids (Lines), date_order (Order Date), partner_id (Vendor)
  • purchase.order.line.merge.line · new modeldiscount, order_id, quantity (Quantity to Merge), taxes_id, wizard_id, price_unit (Unit Price), product_id, product_uom, original_qty, price_subtotal (Subtotal), source_line_id (Source Line)

Text generated by AI (DeepSeek) from reading the Odoo 18.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-03
Confirmed (verified in repository and branch) Estimated (unverified) No information

Confirmation status: 1 confirmed, 8 with no information of 9 versions.

Sources · Odoo 18.0

Confirmed on 2026-11-03 in branch 18.0 of OCA/purchase-workflow.

terminal Installation and usage

OCA documentation · Odoo 18.0
  • Go to Purchase > Orders > Purchase Order Lines.
  • Select the lines you want to merge.
  • Click Action > Merge into Purchase Order.
  • In the wizard, review or change the vendor and order date.
  • Adjust the quantities and/or unit prices if needed. The default quantity is the available amount (original minus the greater of invoiced or received).
  • Click Merge Lines to create the new purchase order.

The original purchase order lines will have their quantities reduced by the merged amount. If all lines of a purchase order reach zero, the order is automatically cancelled.

Validations will prevent merging lines from different currencies, different warehouses, or cancelled/locked orders.

No verified information in OCA: Installation, Configuration.

info

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.