Allow to configure the default lead/delivery time for all products

Rational

The lead time of a product is used to determine when the goods will be delivered to the customer.
Currently it has a default value of an empty timedelta which means that the products are delivered inmediatly.

It is quiet frequent that most companies has a default delivery time for all of the products they have on the stock. Furthermore, if the current default is wrong for the company it allows the user to create a product with a wrong timedelta without any notice.

This is also possible for supplier side. The supplier has a supply time for all of it’s products so I think we should be able to store this information on the party form (under the supplier tab).

Proposal

On sale module:

Add a multivalue lead_time on product configuration to allow to define the default lead time for each product. This value will be used as default value when creating a new product.

On purchase module:

Add a deliverty_time on party form allow to define the default lead time for each product. This value will be as lead time when the product_supplier has no delivery time.

Implementation

issue9420

There is no standard delivery time for a customer - it is per customer/material combination. In other words, it does not make sense to preset a delivery time per material or per customer.
Setting these values should be part of the implementation process.

What I propose is just a default value which already exist but the user can not set it.
You can update it for each product to a lower/bigger value whenever you want.

Then it makes sense to have a place to specify the value so everyone can configure the value to be used on it’s database :wink:

I guess it will be MultiValue per company by default. But we must think that we should allow to customize to be also per warehouse.

Will it not be better to use the configuration value as fallback when the field is empty. Like that it is possible to update at once all the default lead time.

I prefer this solution.

Makes sense so we must remove the default value for the lead time.

I’ve filled Issue 9420: Add default lead/delivery time for product and suppliers - Tryton issue tracker which implements it.