Skip to content

Shopping list quantity is in the wrong units #315

Open
@BenBergman

Description

@BenBergman

Unless all relevant information is provided, I can't help you

Describe the bug
When viewing the shopping list in Grocy, the correct units are used for quantity (ie. "Default quantity unit purchase").
image

image

In the shopping list attributes, the unit used is the "Quantity unit stock" (see the 'amount' field).

{'id': 1, 'product_id': 2, 'amount': 60.0, 'note': None, 'product': {'name': 'Nature Clean Natural Dishwasher Pods, 60 count', 'id': 2, 'product_group_id': 2, 'available_amount': 0.0, 'amount_aggregated': None, 'amount_opened': None, 'amount_opened_aggregated': None, 'is_aggregated_amount': None, 'best_before_date': None, 'barcodes': ['058951380207'], 'product_barcodes': [{'barcode': '058951380207'}], 'amount_missing': None, 'is_partly_in_stock': None, 'default_quantity_unit_purchase': {'id': 3, 'name': 'Pack', 'name_plural': 'Packs', 'description': None}}}

When I change the "Quantity unit stock" to match "Default quantity unit purchase", the amount displayed is as I would expect.

Expected behavior
The amount for the shopping list item should match the shopping list in Grocy UI, ie. it should be in the "Default quantity unit purchase" unit, or at the very least have this added as on additional field.

To Reproduce

  1. Create a product in Grocy and use different units for "Quantity unit stock" and "Default quantity unit purchase".
  2. Add the product to your shopping list
  3. Compare the amount in the Grocy UI for the shopping list and the products attribute of sensor.grocy_shopping_list

General information to help debugging:

Core 2024.11.3
Supervisor 2024.11.4
Operating System 13.2
Frontend 20241106.2

Grocy 4.2.0 (installed as add-on)
Grocy custom component 4.11.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions