Skip to content
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: Same ingredient in parent/sub recipe breaks recipe stock fulfillment checking #2535

Open
BaccanoMob opened this issue May 11, 2024 · 1 comment
Labels
Milestone

Comments

@BaccanoMob
Copy link

Steps to reproduce:

  1. Add subrecipe with Ingredient A and amount 1 and save.
  2. Add recipe with Ingredient A and amount 2 and include subrecipe, then save.
  3. Stock Ingredient A with exactly amount 2.
  4. Go to recipes, you will see stock requirements are fulfilled since individually they do fulfill but recipe should not since total required is actually 3.
  5. Consume Ingredient A with amount 1.
  6. Go to recipes, you will see stock requirements are not fulfilled for recipe but it will say its missing only 1 but it should be 2 (subrecipe is good to go since it needs just 1).

Bug:
This happens if the same ingredient is used at different recipes. The main recipe's ingredients value is only used rather than cumulative

Additional info:
If there is an Ingredient B involved
Steps to reproduce:

  1. Add subrecipe with Ingredient A and amount 1, Ingredient B and amount 1and save.
  2. Add recipe with Ingredient A and amount 2 and include subrecipe, then save.
  3. Stock Ingredient A with exactly amount 2.
  4. Go to recipes, you will see stock requirements are not fulfilled since Ingredient B is missing (note: recipe also does not fulfill due to subrecipe).

So the requirements fulfilled works properly when the ingredients do not match/collide with the recipes involved.

@BaccanoMob BaccanoMob added the bug label May 11, 2024
@berrnd berrnd changed the title Bug: Requirements fulfilled are showing enough stock when it should not when using sub recipes Bug: Same ingredient in parent/sub recipe breaks recipe stock fulfillment checking May 11, 2024
@berrnd berrnd added this to the vNEXT milestone May 11, 2024
@berrnd
Copy link
Member

berrnd commented May 11, 2024

A persistent demo instance can say so much more than any words can ever describe (also mentioned on the issue template).

So I took the time and created one based on what's described for the first example above, so far reproducible there:
https://test-tnaz32tb81nevsw42xkq7p.demo-prerelease.grocy.info/recipes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

2 participants