Amendment for Sale and Purchase

Rational

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.

Implementation

https://bugs.tryton.org/issue8366
https://bugs.tryton.org/issue8494

1 Like

Not sure that we need a new document. Recording the changes to an existing document creates an audit trail as well.

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.

I think it depends of the point of view.

You may consider that change as change on the whole sale or you may consider it as a a change on the sale plus a new sale (for the new line added).

So IMHO I would choose the point of view which will be the simplest from the technical implementation side.

I think this would be very welcomed by users.

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

Only because you ask for.

Sales are not long term projects.

But reality is pertinent… Requirements (or availability) may change in the time between a purchase order is reserved and later delivered.

Projects are contracts, which are routinely subject to amendments.

Oddly enough, sales are contracts too…
Primary differences are the duration and terms(or conditions).