-
-
Notifications
You must be signed in to change notification settings - Fork 540
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bug: Nested recipe on meal plean: Wrong calories/prices/consume amount #2361
Comments
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
Thanks, I think I found where the logic error is (although I don't have it in code yet) Basically, if a recipe is created with an item before a QU conversion is in place, it will not properly update that recipe when the QU conversion is added, unless the offending ingredient is removed and re-added to the recipe. So I removed bacon from the recipe in my example, re-added it, and now it's calculating properly. |
Still needs a reproducible example and I doubt it, QU conversions (and everything else) are of course always taken / calculated "live", nothing is saved at recipe level based on the state of that point in time when the recipe or an ingredient was created/added (would make not that much sense). |
Sorry, I did not have time to test more. I found that if you add another layer to the nested recipe, only the first two layers are in the calculations in the Meal plan. For that, I added Ham Cheese Sandwich, which is the recipe for Ham Sandwich (which is the recipe for Sandwich + the ingredient Ham) + the ingredient Cheese. In the recipe overview, the calculations are correct, but in the Meal plan, only the ingredients from layers 1. and 2. are in the calculations; the "sandwich" part is missing. |
Demo instance: https://test-6yannembxwfbehixjot1v8.demo-prerelease.grocy.info/mealplan?start=2023-10-22
Recipe/ingredients hierarchy:
So when consuming 1 serving of "Ham sandwich" the expectation is that this products will be consumed:
=> ✅ That's the case, regardless of if consuming from the /recipes or /mealplan page.
When consuming 2 servings of "Ham sandwich" the expectation is that this products this will be consumed:
=> ✅ That works when consuming from the /recipes page.
=> ❌ When consuming from the /mealplan page the amount of the nested recipe ("sandwich") ingredients are related to 1 serving only (and this then also affects calories and price calculations).
The text was updated successfully, but these errors were encountered: