Repository
OCA/purchase-workflow · module folder · Try on Runboat
Module version
1.0.0
Category
Inventory/Purchase
Folder size
0.06 MB
License
AGPL-3
Application
No
Auto-installable
No
Website
https://github.com/OCA/purchase-workflow
Last tracking update
2026-09-22 11:15:40
Authors
Odoo Community Association (OCA), SpearHead
Maintainers
Odoo Community Association (OCA), SpearHead
Committers
OCA-git-bot, oca-ci, Ricardo Jara
Odoo dependencies
Python dependencies
None
System dependencies
None
Required by
None
Description
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.

Code Analysis

Views touched (1)
XML IDNameModelTypeStatus
purchase_order_line_merge_form purchase.order.line.merge.form purchase.order.line.merge form New
HTTP endpoints (0)

No HTTP endpoints found for this module.

Models touched (2)

New fields (3)
  • date_order Datetime
    default=fields.Datetime.now required=True string='Order Date'
  • line_ids One2many → purchase.order.line.merge.line
    comodel_name='purchase.order.line.merge.line' inverse_name='wizard_id' string='Lines'
  • partner_id Many2one → res.partner
    comodel_name='res.partner' required=True string='Vendor'
Public methods (2)
  • action_merge(self)
  • default_get(self, fields_list)
    @api.model

New fields (11)
  • discount Float
    related='source_line_id.discount'
  • order_id Many2one
    related='source_line_id.order_id'
  • original_qty Float
    digits='Product Unit of Measure' readonly=True
  • price_subtotal Float
    compute='_compute_price_subtotal' string='Subtotal'
  • price_unit Float
    digits='Product Price' string='Unit Price'
  • product_id Many2one
    related='source_line_id.product_id'
  • product_uom Many2one
    related='source_line_id.product_uom'
  • quantity Float
    digits='Product Unit of Measure' string='Quantity to Merge'
  • source_line_id Many2one → purchase.order.line
    comodel_name='purchase.order.line' readonly=True required=True string='Source Line'
  • taxes_id Many2many
    related='source_line_id.taxes_id'
  • wizard_id Many2one → purchase.order.line.merge
    comodel_name='purchase.order.line.merge' ondelete='cascade' required=True
Public methods (0)

No public methods.