-
-
Notifications
You must be signed in to change notification settings - Fork 725
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error 422 when placing backoffice orders with more items than those available on hand #5784
Comments
@filipefurtad0 @luisramos0 I'm not sure I understand the expected behavior. Why would a manager be allowed to go higher than stock? Most of the users I talk to, don't know their stock info. So the actual behavior described here is something they are asking for. |
Hi @RachL , After PR #5406 it is not possible to exceed stock with backoffice orders, this is one of the changes introduced. After this PR the actual behavior when attempting to exceed available stock in the BO is displaying a payment error message - not informative about stock limitation - and generating an error which turns out in bugsnag as well. I agree it would be useful for users to know about stock limitations in the backoffice, wouldn't this be a feature request? The error/bugnsag alert is introduced by the PR, so I would agree it should retain the original bug severity. |
@filipefurtad0 ok so the error message is missleading, but there is still a workaround. I would leave it as s3. We can see how many request we have at support to see if this is something we need to upgrade in terms of severity. Yet when this happens, I'm still not sure we want the backoffice order to be successful no matter the stock. This will need some product decision. |
Sure, that's indeed a product decision and the message can also be improved, as well. It's the severity of introduced error I am unsure of. But I'm fine with downgrade for now and upgrade later if necessary 👍 |
ok, I just commented on #5300 I am not sure about the "Expected Behavior", maybe an acceptable solution would be to show a meaningful error message that would enable the user to go back and fix the order quantity in the "Order details" page. |
Hi @luisramos0 @RachL , a short FYI note: When opening this issue I took the "Expected Behavior" as is, from 5406, please see Scenario 2 in the description of the PR. I thought the code was being designed in this way, so I kept it's original intention. In any case, the solution you propose sounds good to me as well 👍 |
@filipefurtad0 shouldn't you be away chilling in the sun? :) @luisramos0 meaningful error message sounds good 👍 Do you think we could display it easily when adding quantities on the order detail page rather than on the payment page? |
i am not sure @RachL a question for when a dev picks this up 👍 |
Seems we're getting a 422 as well, if we resume orders which exceed the available stock, as reported here. Orders---OFN-Administration.1.mp4 |
Description
One of the changes introduced by PR #5406 is to prevent stock levels from reaching negative values through backoffice orders. After these changes, creating an order in the backoffice with more items than those in stock is not possible; attempting generates the error on Bugsnag:
https://app.bugsnag.com/open-food-france/open-food-france-prod/errors/5f11cd5d9f0dd90017a69e3d?event_id=5f11cd5d005b6e2ca49f0000&i=sk&m=nw
See also pic below.
Expected Behavior
Placing the order should succeed, but with reduced quantity to the max. available stock.
Actual Behaviour
Attempting to complete a backoffice order with more items than those available in stock fails and displays the message "Error saving payment".
Steps to Reproduce
Opened two browser sessions, both logged in as admin.
Session A: Set the stock level of a product to limited stock with e.g. 4.
Session B: Create an order, Add less than total stock left to cart, e.g. 3.
Session A: Update the stock level of the product to be less than the quantity in cart, e.g. 2.
Session B: Attempt to complete the order: this will fail and display the message "Error saving payment".
Animated Gif/Screenshot
Workaround
After seeing the error, refresh the page and insert the a nr. of items smaller or equal to that available in stock.
Severity
bug-s4
Your Environment
Possible Fix
The text was updated successfully, but these errors were encountered: