Skip to content
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

When switching a product from 'on demand' to 'on hand' the new on hand value doesn't save #2351

Closed
sstead opened this issue Jun 1, 2018 · 4 comments
Assignees
Labels
bug-s3 The bug is stopping a critical or non-critical feature but there is a usable workaround.

Comments

@sstead
Copy link

sstead commented Jun 1, 2018

Description

When a product is taken off 'on demand' and is given an 'on hand' value, the new value entered doesn't always save correctly. Rather than saving the 'on hand' value typed in, the system can save a historic on hand number.

The only way to save both the fact that the product is off on demand, AND the new on hand number is to do it in two steps, saving after each one.

Expected Behavior

If I take an 'on demand' product and give it a on hand value, i want the on hand value I entered to save correctly.

Actual Behavior

Instead of saving the on hand value I put in, the system is pulling up and saving another number.

Steps to Reproduce

  1. Go to products
  2. Make a product on demand - save
  3. Make that product 'on hand' and enter a new stock level. Click save
  4. Check and see if the that got saved was the one you entered.
  5. If the correct number was saved, repeat steps 2-4 for the same product, but this time use a different on hand number. You should see that the old On Hand number gets saved, not the one you actually entered.

Animated Gif/Screenshot

https://www.useloom.com/share/4ee885ded072491582d9f92fcbcb895c

https://www.useloom.com/share/204eeeb78c754f3b9ce768536064afc4

Context

An Aus user controls which products show in their shop by marking those that are unavailable with zero stock on hand. This means when she creates the OC she just selects all, and knows unavailable products will fall away. This means she'll go through a long list of products and mark in their stock levels - sometime switching something from on demand to a new stock level. If you do this for many products and then save, you won't notice that some of the saved values are not correct- this created problems in your shop - items showing with incorrect stock levels, or unavailable products showing.

Severity

S3

Your Environment

  • PC
  • Chrome
  • Aus production

Possible Fix

Save 2 things at once- the fact that the product is no longer on demand, and the NEW on hand number typed in.

@sstead sstead added the bug-s3 The bug is stopping a critical or non-critical feature but there is a usable workaround. label Jun 1, 2018
@frank-west-iii frank-west-iii self-assigned this Jun 8, 2018
@frank-west-iii
Copy link
Collaborator

This is actually a bug in our fork of Spree here:

https://github.com/openfoodfoundation/spree/blob/step-6a/core/app/models/spree/variant.rb#L61

I'll open up a PR for it over there.

@myriamboure
Copy link
Contributor

Fix has been merged but not yet tested, waiting to know what to do.

@sstead
Copy link
Author

sstead commented Sep 7, 2018

Just making a note that this also occurs with product upload and update. If the uploaded CSV tells a product to go from on demand to on hand, it may not save the right on hand figure.

@mkllnk
Copy link
Member

mkllnk commented Sep 7, 2018

I assumed that was solved. @Matt-Yorkley can you confirm that this is a problem with product import?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug-s3 The bug is stopping a critical or non-critical feature but there is a usable workaround.
Projects
None yet
Development

No branches or pull requests

4 participants