stock expiry email notifications
Please verify that this feature request has NOT been suggested before.
- [X] I checked and didn't find a similar feature request
Problem statement
i am looking to get an email when a stock item expires or goes stale.
Suggested solution
if a stock item was able to be auto depleted upon expiry this would work as it would show the item as out of stock. however this would only work if the part went below the minimum stock level
Describe alternatives you've considered
it may also be possible to achieve this by adding an element that detects when the stale stock level goes over say a value of 1.
Examples of other systems
i dont know any other systems that do this
Do you want to develop this?
- [ ] I want to develop this.
@ukawsecurity thanks for raising the issue. This could certanly be implemented by extending our current notifications scheme. Would your company be willing to fund development of this issue?
what sort funding is required?
@ukawsecurity any contributions would be appreciated - there is not a fixed level of funding, but the more funding against an issue, the more likely it is going to attract priority attention from a developer! Some issues receive funding from multiple interested companies / individuals, which helps!
This particular feature I would estimate to take ~5-10 hours of development.
This issue seems stale. Please react to show this is still important.
Hey @ukawsecurity are you still interested in this?
@SchrodingersGat
I am looking for the same: I want to receive an email when a stock item expired. I would like to try to implement this feature. Not sure if I will succeed however ;)
Here is my concept:
- Introduce a new part field "expire_notify_days" where one can enter the days prior a notification shall be sent before expire.
- Show field only if expire toggle in settings in true (like the default expiry field)
- Setting field to 0 -> no notifications are sent if a stock item of this part expires
- implement a scheduled daily task(*): cycling through all stock items and collect those where condition is true: now() > stock_item:expire_date - part:expire_notify_days
- Use the already implemented email notification system (*) to send a templated email
(*) no clue yet, how this is implemented in inventree, but willing to find out.
Is this a way to go?
I am not sure we should extend the part model for this, this sounds like a global setting should cover most use cases and reduce model data and logic complexity.
Fair point.
Was thinking of flexibility:
- You may be interested in notifications only for some expiring parts not all.
- Some parts could have a longer delivery time you want to watch out for; let's say the shipping of part X needs 4 weeks; I want to be notified at least 5 weeks before. But for part Y the shipping only takes 1 week, so a pre notification of 2 weeks is sufficient.
We already have such a setting, the STOCK_STALE_DAYS determines how many days (before it is "expired") a stock item is considered "stale".
Sending out a notification when stock becomes stale should not be too difficult based on a simple daily scheduled task
Thanks for your advises. OK, then let me try to implement the notification based on the STOCK_STALE_DAYS setting 👍