# Which is the reason behind the stock\_lot\_sled not controlling the lot's expiry date?

**URL:** https://discuss.tryton.org/t/which-is-the-reason-behind-the-stock-lot-sled-not-controlling-the-lots-expiry-date/3935
**Category:** User
**Created:** [March 12, 2021, 11:39am UTC](https://discuss.tryton.org/t/which-is-the-reason-behind-the-stock-lot-sled-not-controlling-the-lots-expiry-date/3935 "2021-03-12T11:39:09Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![santi](https://discuss-cdn.tryton.org/letter_avatar_proxy/v4/letter/s/439d5e/32.png) [@santi](https://discuss.tryton.org/u/santi)
#### Post date: [March 12, 2021, 11:39am UTC](https://discuss.tryton.org/t/which-is-the-reason-behind-the-stock-lot-sled-not-controlling-the-lots-expiry-date/3935/1 "2021-03-12T11:39:09Z")

</div>

After using deeply the stock\_lot\_sled with several projects we came up with the previous question. The point is Tryton only checks the lot’s shelf life instead of checking both, shelf life and expiry time or date.

How the solve the situation where the company buys a product which has no shelf life but it does has expiry date? Why does Tryton allow to configure “None” in the shelf life state and “Required” in expiration state?  
The majority of users configure their lots only with the expiration date required and the system allows them to produce with expired entries and serve expired goods.

Shall shelf life state be required when expiration is? Or should the expiry date be checked too after shelf life state when it is “None”?

---

<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: [March 12, 2021, 12:10pm UTC](https://discuss.tryton.org/t/which-is-the-reason-behind-the-stock-lot-sled-not-controlling-the-lots-expiry-date/3935/2 "2021-03-12T12:10:36Z")

</div>

Because it is the shelf life that matters for stock management because it is by definition when the lot can no more be on shelve.

---

<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: [March 12, 2021, 1:55pm UTC](https://discuss.tryton.org/t/which-is-the-reason-behind-the-stock-lot-sled-not-controlling-the-lots-expiry-date/3935/3 "2021-03-12T13:55:46Z")

</div>

> [@santi](#):
>
> The majority of users configure their lots only with the expiration date required and the system allows them to produce with expired entries and serve expired goods.

I see we have “Fecha Caducidad” for the expritation\_date and the term “Fecha Caducidad” is what is more used in Spain.  
Do you think improving the translation may improve the usage from users?

---

<div class="post-metadata">

### Author: ![santi](https://discuss-cdn.tryton.org/letter_avatar_proxy/v4/letter/s/439d5e/32.png) [@santi](https://discuss.tryton.org/u/santi)
#### Post date: [March 16, 2021, 10:33am UTC](https://discuss.tryton.org/t/which-is-the-reason-behind-the-stock-lot-sled-not-controlling-the-lots-expiry-date/3935/4 "2021-03-16T10:33:20Z")

</div>

In terms of usage there are some companies which use the shelf life and expiry date for their products, for example, salt or other species which are sold in groceries and supermarkets. Those products have a shorter shelf life than their expiry date, because those products can’t be sold, when they are just one month ahead of their expiry date. Just like in supermarkets where you may display a product until a couple of days before of its expiry date, not closer. But you can “use” such product until the expiry date if you purchase it.

However, in the other hand, we have those commodities or production entries which have no shelf life, they only have expiry date. We conclude that it is the same date for both, shelf life and expiry date but why should we enter the same date two times? That is why I was asking if there is any option to manage both dates separately.

---

<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: [March 16, 2021, 10:52am UTC](https://discuss.tryton.org/t/which-is-the-reason-behind-the-stock-lot-sled-not-controlling-the-lots-expiry-date/3935/5 "2021-03-16T10:52:43Z")

</div>

> [@santi](#):
>
> We conclude that it is the same date for both, shelf life and expiry date but why should we enter the same date two times?

It depends on what you want. If you want tryton to avoid moving goods that are before the date use the shelf life date. If you only need to track the date but do not check anything use the expiry date.

---

<div class="post-metadata">

### Author: ![jeromarquez](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/jeromarquez/32/452_2.png) [@jeromarquez](https://discuss.tryton.org/u/jeromarquez)
#### Post date: [March 16, 2021, 11:58am UTC](https://discuss.tryton.org/t/which-is-the-reason-behind-the-stock-lot-sled-not-controlling-the-lots-expiry-date/3935/6 "2021-03-16T11:58:46Z")

</div>

Maybe using a formula to calculate the shelf life using expiry\_date as a variable would be a good option. In this case you can define the shelf life = expiry\_date as default on the product template. In the case of salt you can define the shelf life = expiry\_date - 6 months.  
Just an idea.

---

<div class="post-metadata">

### Author: ![santi](https://discuss-cdn.tryton.org/letter_avatar_proxy/v4/letter/s/439d5e/32.png) [@santi](https://discuss.tryton.org/u/santi)
#### Post date: [March 16, 2021, 2:55pm UTC](https://discuss.tryton.org/t/which-is-the-reason-behind-the-stock-lot-sled-not-controlling-the-lots-expiry-date/3935/7 "2021-03-16T14:55:15Z")

</div>

That is not an option, because if we print labels we have to have different values and print a meaningful date for each one, shelf life and expiry date we can not tangle both and print the expiry date as a shelf life date because we will be missing the expiry date, which is mandatory.

---

<div class="post-metadata">

### Author: ![santi](https://discuss-cdn.tryton.org/letter_avatar_proxy/v4/letter/s/439d5e/32.png) [@santi](https://discuss.tryton.org/u/santi)
#### Post date: [March 16, 2021, 2:56pm UTC](https://discuss.tryton.org/t/which-is-the-reason-behind-the-stock-lot-sled-not-controlling-the-lots-expiry-date/3935/8 "2021-03-16T14:56:29Z")

</div>

Absolutely, that could be an option.

---

<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: [March 17, 2021, 9:25am UTC](https://discuss.tryton.org/t/which-is-the-reason-behind-the-stock-lot-sled-not-controlling-the-lots-expiry-date/3935/9 "2021-03-17T09:25:04Z")

</div>

This is possible with the current implementation by enabling both dates on the product configuration and using the same days for both dates.  
If there should be some delay, you just need to set diferent values for the time.

Of course, this will only work when creating new lots if the user needs to set custom values he should take care of setting the right values. This should not be a big issue as it can be easly customized by adding some on\_change that computes the other date based on the diference of days between both.
