Automatically numbering lots

Currently when producing products which require a lot the number must be explicitly set. But most of the time the lot number can be autogenerated using a sequence as the proupose of this field is to link the products with the production, so all the components and operations can be easly found.

This is specially usefull when working with serial numbers.

I think we should allow to set a lot sequence on production configuration and use this sequence to automatically create a lot for each output product that requires a lot if not set

As this may not be usefull for all tryton setups probably this should be part of a new module.


I think this should be implemented, because serialising/lot a product is a common task.

A little side note:
Rign now stock move can have only a lot. When you want to serialise inbound product, you need to split the move. This is quite tedious. Maybe using a sequence can be a solution here.

Side-side note (almost off-topic):
What about supporting sequences based on uuid?
This can be useful for integrating a hybrid workflow, like pre-printing uuid sticker to affix to product/stock, or having a sticker printed on demand via tryton.

I think the configuration should be set per producible product (and even maybe per product-bom) because it is quite common that the production number format depend on this.

Ok but I think it will be good to also have a default value for it so simpler cases can be easly managed.

there is already a module doing this from NaN-tic:

I’m using this since a few years. could be at least a place to start with…

Indeed the proposal is to replace this module and inclue it as part of the trytond oficial modules.

For me the stock_lot_sequence module does to much things and the idea is to simplify. Do you think the current proposal also fits your current usage of the module or do you have some special case to be solved?

Your feedback will be much appreciated.

I just had another look at the module.
Except the company configuration, i think it is quite to the point. Your Proposal includes even more: stock_lot_sequence does only fill the lot number at creation, you proposed to generate the whole lot automaticly within production.

I have made several modules to deal with lots on my own. one of them adds a button at the production output move to automaticly create the lot, and if there is no required lot when the production is run, it also gets generated automaticly. So this point would fit me too.
But as i’m using stock_lot_sled and i added additional Fields to the lot, some more information is requiered to fill in the lot data. my module takes them from the product input lots. But so these have to be checked to be filled first.

Another configuration i have made in the Product is, if you want to use the expiary date as a lot number, but this of cause onli works with stock_lot_sled, so it has to be in a extra module

If you build a official module i will use it, but i will anyway have to review my modules to fit with the changes.