You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Bug: Cannot consume recipe if ingredients with disabled stock fulfillment checking (inventory check) in there (aka how to handle optional ingredients?)
#2533
"{\"error_message\":\"Amount to be consumed cannot be > current stock amount (if supplied, at the desired location)\"}"
That is technically correct, but surprising, as the Frontend (obviously) shows "Enough in stock".
Furthermore, if you have, say 10 ingredients, it does not say which ingredient causes the error and you cannot see it in the overview – again, it's shown as "Enough in stock".
What should happen
first of all, maybe directly showing such a user-friendly error may be an option instead of hiding it behind this generic error:
That said, if the error is in the Frontend there are two options:
that recipe should not be consumable -> then, the button to consume should not be clickable/disabled, as it is when inventory checking is enabled (though as you cannot see why it is not consumable, IMHO this would not be a good solution)
or, as I guess it's rather the case, the recipe should be consumable, but it should ignore the ingredient, which are marked as without "stock fulfillment checking"?
Actual use case
I guess the expected behaviour depends strongly on the use case here.
So what was my actual use case in production? Well… easy… I want "optional ingredients" aka ingredients, which can be added to a recipe, but are not required for it. E.g.
toppings on top of it
side dishes like apple purée to rice budding or so…
etc.
IMHO these warrant no new recipe and there can be a lot. E.g. for said rice budding you could optionally have/add (and have as an optional ingredient) apple purée, chocolate, cinnamon (and/or) sugar as a topping etc. etc. These are all just slight variations on the recipe, and all combinations of the three variants would already warrant like dunno… 6 different variants? 6 recipes would certainly be an overkill for this…
Anyway, thus I select "Disable stock fulfillment checking for this ingredient", because I do not have to have this in stock for the recipe. I can make the recipe as it is, but just may add the ingredient if needed.
Alternative idea
A very cool solution for the issue at hand would be that, in case of such an "optional ingredient" in the recipe:
if it is tried to be consumed, show a list of all optional ones (and how much you actually have in stock), and you can (de)select each ingredient
Recipe can obviously only be consumed if ingredients that are in stock have been checked.
All ingredients selected are then consumed…
This would circumvent the error, as no ingredients are tried to be consumed, which are not in stock.
I would also remove the "Enough in stock" label for items, which have this checking disabled and actually are not in stock and just don't show the "Enough in stock" label (this is how Grocy for Android AFAIK does it) or show something like "stock is not checked for this ingredient".
More information
FYI, this is how it is shown compared to when inventory checking is enabled:
Also, on Grocy for Android such an internal error message is quite fatal, as it does not show the error at all, but just says an error happened… Created patzly/grocy-android#866 for that.
The text was updated successfully, but these errors were encountered:
I guess the expected behaviour depends strongly on the use case here.
True words. But what's the point then about reporting something personal use case specific as a bug and not as an enhancement idea?
I want "optional ingredients"
This is not something Grocy currently has as of today. "Disable stock fulfillment checking for this ingredient" does what it says and nothing more, especially not magically giving a non existent "optional ingredients feature" for specifically your expected personal use case.
You mix multiple topics and even unrelated community contributed project requests here - that's untrackable and therefore explicitly mentioned in the issue template to avoid.
Most of you what you personally expect is already tracked in those other (proper) Feature Requests - feel free to add your ideas there if you really think it's not already covered by what's written there (and please check existing requests beforehand next time and don't report each and everything you personally want to behave differently as a bug):
STR
grocytreprdoucer.mp4
Reproduce on https://test-hx3ngku7e60u2dztka2kw.demo-prerelease.grocy.info/recipes?recipe=7# with the "Test" recipe.
What happens
Error message and internal server error:
"{\"error_message\":\"Amount to be consumed cannot be > current stock amount (if supplied, at the desired location)\"}"
That is technically correct, but surprising, as the Frontend (obviously) shows "Enough in stock".
Furthermore, if you have, say 10 ingredients, it does not say which ingredient causes the error and you cannot see it in the overview – again, it's shown as "Enough in stock".
What should happen
Actual use case
I guess the expected behaviour depends strongly on the use case here.
So what was my actual use case in production? Well… easy… I want "optional ingredients" aka ingredients, which can be added to a recipe, but are not required for it. E.g.
IMHO these warrant no new recipe and there can be a lot. E.g. for said rice budding you could optionally have/add (and have as an optional ingredient) apple purée, chocolate, cinnamon (and/or) sugar as a topping etc. etc. These are all just slight variations on the recipe, and all combinations of the three variants would already warrant like dunno… 6 different variants? 6 recipes would certainly be an overkill for this…
Anyway, thus I select "Disable stock fulfillment checking for this ingredient", because I do not have to have this in stock for the recipe. I can make the recipe as it is, but just may add the ingredient if needed.
Alternative idea
A very cool solution for the issue at hand would be that, in case of such an "optional ingredient" in the recipe:
This would circumvent the error, as no ingredients are tried to be consumed, which are not in stock.
I would also remove the "Enough in stock" label for items, which have this checking disabled and actually are not in stock and just don't show the "Enough in stock" label (this is how Grocy for Android AFAIK does it) or show something like "stock is not checked for this ingredient".
More information
FYI, this is how it is shown compared to when inventory checking is enabled:
![grafik](https://private-user-images.githubusercontent.com/11966684/327956523-dded1338-cfa2-4aea-ab39-3da1566efd43.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjA0NTIwNTAsIm5iZiI6MTcyMDQ1MTc1MCwicGF0aCI6Ii8xMTk2NjY4NC8zMjc5NTY1MjMtZGRlZDEzMzgtY2ZhMi00YWVhLWFiMzktM2RhMTU2NmVmZDQzLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA3MDglMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNzA4VDE1MTU1MFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWNiNTgwNDAyZTFmMmQ4YmEzNDYwZTgwMzJlYzRlNGQzNjljYWMzZmVmMWI0MzBiMzE2Nzc3NDdmMjc4OTM3MDUmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.eqxhmB-B3oLgKviI4P-CLYYtHyfJvhiyuV1fXwjvdD0)
Also, on Grocy for Android such an internal error message is quite fatal, as it does not show the error at all, but just says an error happened… Created patzly/grocy-android#866 for that.
The text was updated successfully, but these errors were encountered: