A confirmed order is a contract between the company and a party. This is why it can not be changed by default.
But in some cases, both parties can agree on amending the “contract” to change some part. In this case a new revision of the order should be created and used for further actions.
Proposal
New modules sale_amendment and purchase_amendment will have quite the same design.
Design
The orders must be “historized”.
A new document is created to define an Amendment:
sale or purchase
date
description
state: draft, validated
lines:
action: list of actions
extra fields needed for actions
When the amendment is validated, it update the order and increase the revision number. Some checks must be performed when applying which will prevent the validation. The order must be processed after the change to correctly create new lines, all draft lines (and/or) document should be deleted before.
The possible actions:
Recompute taxes: change the taxes lines according to the party tax rules and product taxes.
Update header field:
payment term
parties and addresses
warehouse
Update line field:
product: with the same unit category (like for the shipment)
quantity: must be at greater than already shipped or invoiced quantity.
unit price: defined manually
description
Access Rights
Amendment creation will be accessible to user who can create the order.
The validation of amendment will be restricted to a specific group.
I’m wondering if it makes sense to include the option to add new lines to previous sale and or purchase.
An use case: Customer has request 2 quantities of a product but before delivery it request to change to another. So the ammendament should update the previous quantity settting it to zero and add new line with the new product.
We did not want to support to add new line because it would require to manage all the line behavior in the amendment (e.g. price computation, tax setup, promotions etc.).
Also changing the quantity of an existing line is OK as at least you have supply for the initial quantity but with a new line you do not know if you have enough quantities at the shipping date.
So it is simpler and provides a better user experience to create a new sale when customer request new products.
This is relatively frequent for our purchases.
We also have similar need in long term project sales where amendments are common
(lines +/-); no comment for simple sales of merchandise.
no comment for