Grocy: Variations of the same product

Created on 17 Mar 2019  Â·  3Comments  Â·  Source: grocy/grocy

For example with milk there's chocolate, strawberry, skim, etc.

Even if they're added as separate items it'd be nice to have a way to link them.

enhancement

Most helpful comment

I'll be working on this issue in my down time

All 3 comments

Potential easy solution would be a product-subgroups.

Allow nesting product groups.
Dairy > Milk (with w.milk, choc.milk, straw.milk)
Ingredients > Sugar (brown, white, icing)

Would allow for much more granular sorting, and wouldn't complicate anything by creating a "master product" that holds multiple actual products.

I'll be working on this issue in my down time

This is now done like @Wdavery proposed: :)

  • Define the parent product for a product on the product edit page (only one level is possible, means a product which is used as a parent product in another product, cannot have a parent product itself)
  • Parent and sub products can have stock (both are regular products, no difference from that side)
  • On the stock overview page the aggregated amount is displayed next to the amount (sigma sign)
  • When a recipe needs a parent product, the need is also fulfilled when enough sub product(s) are in stock

    • API change (no breaking change): ​/stock​/products​/{productId} returns additional fields for the aggregated amount(s): stock_amount_aggregated and stock_amount_opened_aggregated - contains the same for "normal" products, is_aggregated_amount indicates if aggregation has happened

Demo product is "Chocolate" with the variations "Milk Chocolate" and "Dark Chocolate": https://demo-prerelease.grocy.info

grafik

grafik

I'm not fully happy with the UI part, but it works - if you have further ideas on this, always welcome... :)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jayaddison picture jayaddison  Â·  5Comments

skettydog picture skettydog  Â·  4Comments

dbxx picture dbxx  Â·  3Comments

CorneliousJD picture CorneliousJD  Â·  4Comments

dilshandiss picture dilshandiss  Â·  5Comments