# Amendment for Sale and Purchase

**URL:** https://discuss.tryton.org/t/amendment-for-sale-and-purchase/187
**Category:** Feature
**Tags:** purchasing, sales
**Created:** [August 17, 2016, 2:01pm UTC](https://discuss.tryton.org/t/amendment-for-sale-and-purchase/187 "2016-08-17T14:01:42Z")
**Posts on this page:** 10
**Page:** 1

<div class="post-metadata">

### Author: ![ced](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/ced/32/1237_2.png) [@ced](https://discuss.tryton.org/u/ced)
#### Post date: [August 17, 2016, 2:01pm UTC](https://discuss.tryton.org/t/amendment-for-sale-and-purchase/187/1 "2016-08-17T14:01:42Z")

</div>

# 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

> **[Add history and revision (#8366) · Issues · Tryton / Tryton · GitLab](https://foss.heptapod.net/tryton/tryton/-/issues/8366)**
>
> In order to implement https://discuss.tryton.org/t/amendment-for-sale-and-purchase/187, we need to manage revision and history on sale and purchase orders.

> **[Add amendment (#8494) · Issues · Tryton / Tryton · GitLab](https://foss.heptapod.net/tryton/tryton/-/issues/8494)**
>
> Following https://discuss.tryton.org/t/amendment-for-sale-and-purchase/187

---

<div class="post-metadata">

### Author: ![coogor](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/coogor/32/47_2.png) [@coogor](https://discuss.tryton.org/u/coogor)
#### Post date: [July 16, 2019, 7:27pm UTC](https://discuss.tryton.org/t/amendment-for-sale-and-purchase/187/2 "2019-07-16T19:27:49Z")

</div>

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

---

<div class="post-metadata">

### Author: ![pokoli](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/pokoli/32/22_2.png) [@pokoli](https://discuss.tryton.org/u/pokoli)
#### Post date: [September 12, 2019, 9:04am UTC](https://discuss.tryton.org/t/amendment-for-sale-and-purchase/187/3 "2019-09-12T09:04:09Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![josesalvador](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/josesalvador/32/602_2.png) [@josesalvador](https://discuss.tryton.org/u/josesalvador)
#### Post date: [September 12, 2019, 9:41am UTC](https://discuss.tryton.org/t/amendment-for-sale-and-purchase/187/4 "2019-09-12T09:41:08Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![albert](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/albert/32/21_2.png) [@albert](https://discuss.tryton.org/u/albert)
#### Post date: [September 12, 2019, 10:36am UTC](https://discuss.tryton.org/t/amendment-for-sale-and-purchase/187/5 "2019-09-12T10:36:45Z")

</div>

> [@pokoli](#):
>
> 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 this would be very welcomed by users.

---

<div class="post-metadata">

### Author: ![ced](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/ced/32/1237_2.png) [@ced](https://discuss.tryton.org/u/ced)
#### Post date: [September 12, 2019, 11:24am UTC](https://discuss.tryton.org/t/amendment-for-sale-and-purchase/187/6 "2019-09-12T11:24:38Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![risto3](https://discuss-cdn.tryton.org/letter_avatar_proxy/v4/letter/r/a87d85/32.png) [@risto3](https://discuss.tryton.org/u/risto3)
#### Post date: [September 12, 2019, 5:10pm UTC](https://discuss.tryton.org/t/amendment-for-sale-and-purchase/187/7 "2019-09-12T17:10:17Z")

</div>

> [@pokoli](#):
>
> 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.

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

---

<div class="post-metadata">

### Author: ![ced](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/ced/32/1237_2.png) [@ced](https://discuss.tryton.org/u/ced)
#### Post date: [September 12, 2019, 8:29pm UTC](https://discuss.tryton.org/t/amendment-for-sale-and-purchase/187/8 "2019-09-12T20:29:33Z")

</div>

> [@risto3](#):
>
> This is relatively frequent for our purchases.

Only because you ask for.

> [@risto3](#):
>
> We also have similar need in long term project sales

Sales are not long term projects.

---

<div class="post-metadata">

### Author: ![risto3](https://discuss-cdn.tryton.org/letter_avatar_proxy/v4/letter/r/a87d85/32.png) [@risto3](https://discuss.tryton.org/u/risto3)
#### Post date: [September 12, 2019, 9:02pm UTC](https://discuss.tryton.org/t/amendment-for-sale-and-purchase/187/9 "2019-09-12T21:02:52Z")

</div>

> [@ced](#):
>
> > This is relatively frequent for our purchases.
> 
> Only because you ask for.
> 
> > We also have similar need in long term project sales
> 
> 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).

---

<div class="post-metadata">

### Author: ![ced](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/ced/32/1237_2.png) [@ced](https://discuss.tryton.org/u/ced)
#### Post date: [October 13, 2019, 4:00pm UTC](https://discuss.tryton.org/t/amendment-for-sale-and-purchase/187/10 "2019-10-13T16:00:07Z")

</div>

This topic was automatically closed after 13 days. New replies are no longer allowed.
