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

Error when changing weights in bulk order management due to stock levels #2883

Open sineadfenton opened 6 years ago

sineadfenton commented 6 years ago

Description

This has been reported by Tamar

Each week Sara will update a series of invoices with the final weights that products come in at. One producer has a series of products with weights that are variable, so each week, these will change. The initial product sold will be 300g for £2, however when deliveries are made by producers, what comes in is 270g thus it will be £1.75, Sara will adjust the price based on an adhoc basis for those orders in question.

To do this, Sara will go to bulk order management, finds the order to amend and makes the amendments. When trying to save, the system does not allow it stating "error - exceeds available stock". Because the stock has reduced in the current order cycle the system doesn't allow you to make a change to something that is already accounted for.

To get around this Sara goes to products, amends the stock quantities, goes back to bulk order management, makes the necessary changes, saves, and goes back to products to change the stock quantities.

Expected Behavior

Sara previously used to be able to change the orders, weights and prices without any issues (approx aug 2018), however has since, not been able to do so.

Actual Behavior

The error messages comes up as the accounted for stock isn't recognised and it's as if the changes are considering past quantities.

Steps to Reproduce

  1. Go to orders, bulk order management and put in a date time frame to pull up a recent order
  2. Search for the producer Trehill Farm
  3. Try to amend the weight of a product (sausages for instance, just make a record of which one). Click save (1.55min in video)
  4. Error message "exceeds available stock. Please ensure line items have a valid quantity)

To get around the error, the following is done@

  1. Go to products, find the producer Edit an item and increase its stock. Save.
  2. Go back to bulk order management and try to make the change now and it will work
  3. Go back to the products page, and revert the changes made to the item bringing the stock back down to what it originally was

Best to do on tamar and trehill farm as this is the enterprise that the issue arises with (changes in weight weekly)

Animated Gif/Screenshot

http://recordit.co/cYN4cqWhdF

Context

The process flow is a lot longer now. If something is accounted for, it would seem okay to be able to amend its details, especially as weights etc can be variable and this is only know at the point of production rather than prior.

Severity

bug-s5: we can live with it, only a few users impacted

Your Environment

Possible Fix

Revert back to previous. Sara used to be able to make these changes without any issues previously. Users can make changes to the orders

sineadfenton commented 6 years ago

Bulk Order Management