As commerce_stock only kicks its rule in when an order goes through the front end, not the backend, it would be cool to have a "decrease stock level by one" bulk action which we could apply to a list of commerce products.

CommentFileSizeAuthor
#6 commerce_stock-views_added-1759452-3.patch15.86 KBAnonymous (not verified)
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

guy_schneerson’s picture

Hi @aidanlis sounds like a cool idea, however not sure how useable it would be without a value per a product to Inc/Dec. not sure if you can do this with vbo?

One thing that's on my list of things to do is make it easier to interact with the API (major re-write on the way) this will make it easier to add functionality like VBO / Order Admin management ...

aidanlis’s picture

For my use case "-1" would be sufficient, but you can pass arguments to the action fairly easily allowing you to do it per-sku or globally.

I think the stock value should be removed from the product edit page altogether - if you have a high volume store it's not possible to edit a product without destroying your stock level e.g. in the time it takes me to edit the product and click save, the stock value has decreased several times, but the form value is oblivious!

xatoo’s picture

Title: Add a "decrease stock level" action / views bulk operation » Allow changing stock levels by using a views form element.

I agree with #1 that using VBO might not be the best approach. I suppose that in most use cases, people would like to change the stock levels of different products with different values. It would be nice if we could achieve some kind of views integration in which we can alter stock levels just like we do now in the cart form with line item quantities.

aidanlis’s picture

Ideally we'd be doing double book inventory ... anything else isn't going to be good enough for a fully flegded store.

guy_schneerson’s picture

@aidanlis what are you referring to by "double book inventory" is it "physical inventory" and "book inventory" book meaning the stock level held by the site?
Can you elaborate?

Anonymous’s picture

Status: Active » Needs review
FileSize
15.86 KB

Based on #3 I've created an views handler and an views page so that the stock easilly could be managed from within a view.

Maybe you guys could test it for me.

guy_schneerson’s picture

@wbressers - great work, looks good (but didn't get a chance to test).
However I think the original point is still valid and we need both the ability to set stock level (your patch) and the ability to "increase/decrease stock level".

The lack of the increase/decrease functionality however doesn't stop us from getting #6 into the module so any one that got time please test and report back I should have some time soon to give this more attention.

xatoo’s picture

Status: Needs review » Needs work

Looking good! I have a few small remarks and agree with guy_schneerson and aidanlis that there should be a way to mutate stock levels by a certain amount rather than to provide new values. If you allow me I will try to alter your work with support for that.

aidanlis’s picture

@guy_schneerson It's the same as double book accounting, but for inventory.