openfoodfoundation / openfoodnetwork

Connect suppliers, distributors and consumers to trade local produce.
https://www.openfoodnetwork.org
GNU Affero General Public License v3.0
1.12k stars 724 forks source link

[Reports] Wrong "bulk unit size" in bulk co-op supplier report #9747

Open audez opened 2 years ago

audez commented 2 years ago

Description

The "bulk unit size" field in the bulk co-op supplier report is displaying 0 value instead of the bulk unit size.

Steps to Reproduce

  1. Create a product with group by option on "yes" and set bulk unit value to 30 for instance
  2. Pass an order with this product
  3. Go to admin/reports/bulk_coop and see that the bulk unit size column is not displaying the value you previously set

Animated Gif/Screenshot

I chose "bulk unit size = 30" for the "Amandes vrac" product

Capture d’écran 2022-10-06 à 11 29 21

bulk co-op Supplier report

In admin/reports/bulk_coop, Supplier report, 0 value is displayed

Capture d’écran 2022-10-06 à 11 29 43

bulk co-op Allocation report

In admin/reports/bulk_coop, Allocation report, the right value (30) is displayed. But with #9745 it's not possible to rely on this report.

Capture d’écran 2022-10-06 à 11 37 22

Severity

bug-s3: a feature is broken but there is a workaround

krishnasingh001 commented 2 years ago

Hello @audez I would like to work on this one. Could you please assign it to me?

RachL commented 2 years ago

hello @krishnasingh001 just checking in: are still working or planning to work on this issue? Don't hesitate if you need help :)

krishnasingh001 commented 2 years ago

Hello @RachL, I wasn't able to reproduce this issue locally. I thought this issue has been fixed. But will check this issue again and update it here. Thanks

RachL commented 1 year ago

@lin-d-hop this one might be a good candidate for the reports update epic?

rioug commented 1 year ago

Hi @RachL , I am having a look at this.

As krishnasingh001 mentioned above, I wasn't able to reproduce the issue on my first try. I am having a look at the code now to double check if there isn't any edge cases.

rioug commented 1 year ago

Hi Again,

I went and looked at the code, as far as I can see it's getting the correct data. So unless I missed something, this has been fixed. For context, report where improved by this PR #9032 and the code hasn't changed since.

See below the steps I took to try reproducing the bug. :

  1. Add "group buy option" to a product, set Garlic bulk unit size to 25 garlic_group_by_option

  2. Place an order with said product, Garlic is showing the bulk icon buy_garlic_bulk

  3. Run the Bulk Co-OpSupplier Report, the correct unit size of 25 is shown for Garlic bulk_coop_supplier_report

RachL commented 1 year ago

@audez are you still able to reproduce this one? If so, can you provide the step you did?