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

[Spree upgrade] Impossible to update stock info (on hand and on demand) #3573

Closed
RachL opened this issue Mar 4, 2019 · 10 comments
Closed

[Spree upgrade] Impossible to update stock info (on hand and on demand) #3573

RachL opened this issue Mar 4, 2019 · 10 comments
Assignees

Comments

@RachL
Copy link
Contributor

RachL commented Mar 4, 2019

Description

I can't see the field in order to update a stock info in a variant. When creating a product everything is ok.

Steps to Reproduce

  1. Go to https://staging.openfoodfrance.org/admin/products
  2. Edit a variant. E.g. https://staging.openfoodfrance.org/admin/products/apple-cider-1-2/variants/12/edit
  3. You won't see the on hand stock field neither the on demand checkbox.

Animated Gif/Screenshot

image

Severity

bug-s1: a critical feature is broken: checkout, payments, signup, login

Your Environment

  • Version used: ??
  • Browser name and version: Firefox 64
  • Operating System and version (desktop or mobile): Ubuntu 18.10
@kreopelle
Copy link

@RachL - Is this issue still open?

@RachL
Copy link
Contributor Author

RachL commented Mar 4, 2019

@kreopelle Hello Kayla and welcome to the community :-) yes this issue is still open. However if you are looking for something to start with, I suggest you take a look at the issues labeled "good first issue" : https://github.com/openfoodfoundation/openfoodnetwork/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22

This one is part of an upgrade of our main dependency and may required to know a bit more our platform before working on it.

If you need anything, do not hesitate to ask around here or join our slack channel :)

@luisramos0 luisramos0 self-assigned this Mar 6, 2019
@luisramos0
Copy link
Contributor

there's a new page called stock management for this! I just discovered it...

screenshot 2019-03-07 at 22 49 09

I just need to find out how to set the right permissions so we can see the menu option enabled.

@luisramos0
Copy link
Contributor

luisramos0 commented Mar 7, 2019

This spree v2 page has two problems:

  • it handles stock locations but because there's only one stock location in ofn v2, it's just a select box with one option always.
  • also, on_demand is backorderable here. backorderable is like on_demand BUT you can manage stock even if backorderable is activated... on_demand in other parts of ofn v2 is used to disable on_hand.

I'lll see what are the best/easiest options out of these problems, so we can decide what to do...

@kreopelle
Copy link

Thanks @RachL ! I'll look for another :)

@luisramos0
Copy link
Contributor

luisramos0 commented Mar 12, 2019

hey @RachL the stock management menu entry is available, no permissions changes are needed.
you can have a look in AU staging now: https://staging.openfoodnetwork.org.au/admin/products/potatoes-1/stock

This page actually works well! In this page you can change stock, but with stock deltas: you can add negative values to decrease for example. The stock location is always default and it works. It's only a UX problem... this stock location is also present in the orders edit page when we add variants to the order.

The backorderable problem is also just a naming, because this field is actually on_demand.

The delete button works and resets stock to zero.
You can play with this page and see how it interacts with the bulk product edit page fields.

So, the easiest way out of this is to rename "Backorderable" to "On demand" and leave everything as is...

What do you think @RachL ?

@RachL
Copy link
Contributor Author

RachL commented Mar 14, 2019

@luisramos0 ok for this, however while playing with it I saw 3 weird things:

  1. In the stock management menu, the "Variant" dropdown is always empty no matter the number of variants the product has
    image

So I never managed to "add stock" this way. Also I'm a bit confused: isn't editing the figure below enough? I would suggest we hide this upper part, what do you think?

  1. I noticed that if I delete a line in the stock management menu, the stock of the variant does indeed change to 0 but afterwards I can't edit it anymore through the main page. I get a 500 error:

image

And I can't do it in the edit / stock management menu anymore as I deleted the line.
We can either remove the delete option or fix this.

  1. When you add stock info and then change to on_demand, the stock info stays. We should have the same display as we have on main page (=> "on demand writen in on_hand column). Don't you think?

image

Also : can you describe me the use of the "stock location" field?

@luisramos0
Copy link
Contributor

ah, nice!

  1. the dropdown shows the variant sku, if you set the sku in the variants, this dropdown will make sense... maybe we can change this to show a combination of unit_descritpion and sku... or maybe put the variant ID so this is never empty.

  2. I tested something similar but didnt try to update it in the bulk page in the end. I can replicate. I'll have a look at this.

  3. spree backorderable let's you change on_hand. but I agree, we should change this to on_demand and hide on_hand field when on_demand is set.

  4. re stock location, currently nothing can be done with it, there's only one default stock location in the system.

Let's agree on what we do with point 1 and 3.

@RachL
Copy link
Contributor Author

RachL commented Mar 14, 2019

@luisramos0

On 1. Can we just used unit_description? I believe this field has always data, whereas sku hasn't.

On 3. It's too complex to display the text "On demand" in the on hand field if on demand is activated (like on main page)? If yes, then I agree to hide the field.

On more thing Luis, I just added a new enterprise on staging and created a product, but I don't have the stock management menu. What do I need to do to activate it?

image

@luisramos0
Copy link
Contributor

@RachL I have looked at the code now.
The best/easiest thing to do now is actually to just re-add the fields in the variants submenu as in v1 and hide this new stock management page... I'll give it a try and report back.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants