Merge sale orders
This module lets salespeople merge sale orders of the same customer into a single order. The lines of the merged orders move to the target order, and the other orders are cancelled.
Quotations, sent or not, can always be merged, and confirmed orders too when the corresponding setting is enabled. When the target order is confirmed, the pending deliveries of the merged orders are merged with its own, and their draft invoices are merged into one.
Table of contents
Configuration
Quotations, sent or not, can always be merged. To merge confirmed orders as well:
Go to Settings > Sales, section Quotations & Orders.
Enable Merge confirmed orders and save.
The Sales settings page is only shown when the Sales application (sale_management) is installed.
Usage
Merge criteria
An order can be merged with the orders that share its customer, delivery address, warehouse, company and currency, and that are in the Quotation or Quotation Sent status, or also in the Sales Order status when Merge confirmed orders is enabled. The order you merge into must have at least one line.
Merging from the form view
Open a quotation or a sales order. When other orders meet the merge criteria, a Merge button shows in the header.
Click Merge. The wizard lists the order and every order it can be merged with. Remove the orders you do not want to merge; Add a line only offers orders that meet the merge criteria. Merge into is the target order.
Click Merge. The wizard closes and the view it was opened from reloads.
Merging from the list view
In the list of quotations or sales orders, select the orders to merge and choose Actions > Merge selected orders.
The target order is the first one created among the selected orders that are in a status that can be merged. If any selected order does not meet the merge criteria with it, an error lists those orders grouped by the criterion they fail, so you can correct the selection.
Otherwise the wizard opens with the selected orders. Continue as in steps 2 and 3 of the previous section.
What the merge does
The lines of the merged orders move to the target order and the other orders are cancelled. Each cancelled order logs “Merged into” the target in its chatter, and the target logs the orders merged into it.
When the target order is confirmed, the quotations among the merged orders are confirmed first. The pending deliveries to the customer are grouped by operation type, source location, destination location and partner, and each group is merged into a single delivery: the one of the target order, or the oldest one when the target order has none in that group. Done and cancelled deliveries are kept as they are and linked to the target order.
When the target order is confirmed, the draft invoices of the orders are merged into one, preferably the draft invoice of the target order, and its taxes and due dates are recomputed. Invoices that are not in draft are kept as they are.
When the target order is a quotation and some of the orders to merge are confirmed, the wizard warns that those orders are cancelled and their deliveries are not merged.
When any of the orders merged into the target is locked (Lock Confirmed Sales), the merge stops without changing anything and asks you to unlock those orders first. The quotations that the merge confirms are unlocked so they can be cancelled.
Extending the merge
Other modules can adapt the merge by overriding these methods:
sale.order._can_merge: conditions an order must meet to be merged.
sale.order._get_merge_domain: domain of the orders that meet the merge criteria of an order.
sale.order._get_merge_depends: fields of the order read by the merge criteria. Extend it along with the two previous methods, so that the merge candidates are computed again when those fields change.
sale.order.merge._picking_can_merge: deliveries that can be merged.
sale.order.merge._get_picking_map_key: how deliveries are grouped before merging each group into one.
sale.order.merge._get_merge_result_action: action returned once the orders are merged.
Known issues / Roadmap
With delivery routes in two or three steps, only the deliveries to the customer are merged. The internal transfers before them (pick, pack) are linked to the target order but stay separate.
Bug Tracker
Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported. If you spotted it first, help us to smash it by providing a detailed and welcomed feedback.
Do not contact contributors directly about support or help with technical issues.
Credits
Contributors
Stefan Rijnhart stefan@opener.amsterdam
-
Edilio Escalona Almira e.escalona@binhex.cloud
Maintainers
This module is maintained by the OCA.
OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use.
This module is part of the OCA/sale-workflow project on GitHub.
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
Metadata
Release files for odoo-addon-sale-order-merge 17.0.1.0.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| odoo_addon_sale_order_merge-17.0.1.0.0.1-py3-none-any.whl | Python 3 | none | any | Details for odoo_addon_sale_order_merge-17.0.1.0.0.1-py3-none-any.whl |
Release files / odoo_addon_sale_order_merge-17.0.1.0.0.1-py3-none-any.whl
| Download URL | odoo_addon_sale_order_merge-17.0.1.0.0.1-py3-none-any.whl |
|---|---|
| Size | 1.0 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
986ae47b9319cd54221ee311439fbcaa9ed5b5e4db3a37cf69d5a501e6be51a5
|
|
BLAKE2b-256 checksum How to use checksums |
2d2c24c17d89022a212f1a849d7505eecd9ba3dce5b14b8870f833fa278a3518
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.4
|
Security for odoo-addon-sale-order-merge 17.0.1.0.0.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.