Handling "overflowing" quantities with Order Points

Rational

Currently the order points are designed to handle the case when a quantity is below a defined threshold.

There are cases where a company might want to automatically generate internal shipments when a quantity in a location exceed a defined amount (eg: to move the result of the production for example).

Proposal

We propose to add target_quantity on stock.order_point. This quantity will represent the quantity that the order point should reach by moving in (or out) some products in the location.

The overflow_location field will be the stock location where the goods will be moved.

Implementation

The max_quantity field will change its semantic. A migration will be included to copy its value in target_quantity.

Only target_quantity will be required, max_quantity (resp. min_quantity) will be required only if min_quantity (resp. max_quantity) is NULL thanks to a states.

A domain between the different quantities will replace the SQL constraint we use actually to check if max_quantity >= min_quantity.

Contrary to the provisioning case, the overflow case does not come with an implicit minimal quantity. Thus there is no need for a default overflowing location on stock.location.

https://bugs.tryton.org/issue6279

I do not think such constraint is needed. For me, there is only min_quantity <= target_quantity <= max_quantity (if they are defined).

I think it should be allowed to define a default overflow location on a location.This will create an implicit maximal quantity of 0 for this location.

What’s the point of having an order point if it does nothing?

Indeed, it could be useful.

Allow custom module to do something else with it.
Less constraint is more.