LocalOrbit / localorbit

Local Orbit is an open source web application and service that empowers food hubs to efficiently sell and distribute local food.
https://localorbit.com
MIT License
16 stars 11 forks source link

Product does not show up in reports if category depth > 2 #3496

Open rbarreca opened 5 years ago

rbarreca commented 5 years ago

Describe the bug Apparently there are lots of legacy categories with depth > 2 but no way to edit or view in system besides as an admin. If a legacy product is assigned to one of those categories, those products and their sales do not show up in reports. For example, if you go to Purchases by Products and select Broccoli, Cauliflower & Cabbage category. Anything that is in the Vegetables > Broccoli, Cauliflower & Cabbage > Brussels Sprouts category will not show up even though it will show up in report if you do not have a category filter selected.

To Reproduce Steps to reproduce the behavior:

  1. Go to http://app.localtest.me:3000/admin/taxonomy and find a product that is categorized in a depth 3 or above (i.e. 3rd column or to the right)
  2. Make a purchase with that product
  3. Go to Sales by Product report
  4. With no category filter, find a report with that product
  5. Then choose the 2nd level category (only one that you can see/select) from category filter
  6. Refresh report and notice product will not be there

Expected behavior All products assigned to a subcategory under a 2nd level category would show. But, I think the 3rd+ depth categories are NOT exposed anywhere in system so I think the easiest fix would be to reassign all products to a 2nd level category.

User reports