Skip to content

Conversation

@mikejolley
Copy link
Member

This is an attempt to improve #21754 to try avoiding reverting to #22012.

Reasoning explained in the issue comment here.

This makes 3 main changes:

  1. If an item has already reduced stock in an order and is DELETED, the stock for the deleted item is restored. A note is added.

2019-01-03 13 46 37 2

  1. If an item is added to an order manually, stock is reduced immediately for that line item and a note is added.

2019-01-03 14 00 18

  1. Finally, if you edit the qty level of an item which has already had it's stock reduced, it will increase or decrease the difference:

2019-01-03 14 02 01

Everything else is the same. Automated stock events during status change will not double reduce anything because the amounts are stored per line item.

This PR could use feedback from the users in #21754 before merge. I'd recommend for 3.6.

Changelog entry

When adding, editing, and deleting items manually from orders, the corresponding product's stock will be updated to reflect the event and an order note will be logged as a record of it happening.

@mikejolley mikejolley added Enhancement The issue is a request for an enhancement. status: needs review needs: author feedback The issue/PR needs a response from any of the parties involved in the issue. labels Jan 3, 2019
@mikejolley mikejolley added this to the 3.6.0 milestone Jan 3, 2019
@ben72
Copy link

ben72 commented Jan 3, 2019

I still miss the way to easily highlight lines when picking items for an order. Say you have 20 items to get from different places. It's great if you can see the progress just by clicking the lines you've picked so far. Makes sense?

@filpet
Copy link

filpet commented Jan 3, 2019

I still miss the way to easily highlight lines when picking items for an order. Say you have 20 items to get from different places. It's great if you can see the progress just by clicking the lines you've picked so far. Makes sense?

Maybe you can create a separate issue just for a highlighting function as this has got nothing to do with stock management?
Otherwise there are several plugins for picking items and creating picking lists.

@windsorraw

This comment has been minimized.

@rrennick
Copy link
Contributor

rrennick commented Jan 3, 2019

I still miss the way to easily highlight lines when picking items for an order.

See #21754 (comment)

@mikejolley
Copy link
Member Author

Having lines that highlight on click will likely cause confusion as to what they are doing or what is happening. @ben72 Sounds like a potential extension, marking items as picked in a way that persists across page loads. Could be line item meta data.

@mikejolley
Copy link
Member Author

@windsorraw Ill reply in the issue.

@willgorham
Copy link
Contributor

I really like these changes. Great work! FYI I think this PR covers #22107 as well.

@ben72
Copy link

ben72 commented Jan 5, 2019

@mikejolley Sounds reasonable if few people use it like that. I'm just reacting as features I use go away..

@filpet
Copy link

filpet commented Jan 6, 2019

@mikejolley just wondering, would it possible to maybe include product exchange with this new way of editing order lines?

E.g. customer orders blue socks, shop runs out of blue socks and asks customer if red socks are ok.
Customer approves, now the shop owner has to delete the blue socks and add red socks in the same quantity and so on...would be a lot easier if one could just switch the product.

@filpet
Copy link

filpet commented Jan 6, 2019

@mikejolley oh and one more thing which disappeared with removing the line selection:
In case we have to delete multiple products from the order, it's quite a task as we have to delete each single line by itself, one can't select multiple rows! Maybe some kind of multiple selection function could be added back again.

@gpadilha
Copy link

gpadilha commented Jan 15, 2019

@mikejolley Nice job. Just wondering if the DELETED, on item 1, includes trashed orders or it would be just for permanent deleted orders.

*Edit: Just realized that you meant deleted products from the orders. Should products also be restocked when moving to trash orders?

@fatpotanga
Copy link

Interesting. For what it's worth I too really miss the hilighted line feature. I found it really useful.

Would this work for say, lost orders whereby you need to resend in full?
You'd need to mark the stock levels down, but not adjust the order $value

Before the update you could select multiple items and click a single button to increase or reduce stock. This was also useful for exchanges (which I've never found an easy way to do, but that's another conversation.. :)) or having to send out replacement items that were say faulty or damaged.

@mikejolley mikejolley removed the needs: author feedback The issue/PR needs a response from any of the parties involved in the issue. label Feb 18, 2019
@claudiosanches
Copy link
Contributor

@gpadilha

Just realized that you meant deleted products from the orders. Should products also be restocked when moving to trash orders?

No, see that moving an order to trash doesn't only means that you want to restock all your products, sometimes is just to remove from your database.
So if you want to restock all products in an order, it's better of doing it inside the order.

@davidjean170

This is exactly what i need. Is this will be integrate in a future update of WooCommerce or in a plugin ?

Probably in WooCommerce 3.6.

Copy link
Contributor

@claudiosanches claudiosanches left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@woocommercebot woocommercebot added status: approved and removed Enhancement The issue is a request for an enhancement. status: needs review labels Feb 18, 2019
@mikejolley mikejolley merged commit 5397e4e into master Feb 19, 2019
@mikejolley mikejolley deleted the enhancement-manual-stock-changes/21754 branch February 19, 2019 10:00
@davidlonguk
Copy link

Will this be available as a standalone release so we can get this fix without introducing new bugs from 3.6?

@mikejolley
Copy link
Member Author

mikejolley commented Mar 14, 2019

@davidlonguk Nope but feel free to copy paste from the PR and introduce new bugs yourself :p

This PR doesn't fix bugs, it's new functionality, thats why it wasn't added to a 3.5.x fix release.

We'll be tagging 3.6 in a few days. There are other fixes coming in 3.6 and performance enhancements you may also need. You're welcome to help beta test to ensure no new bugs exist a launch :)

@davidlonguk
Copy link

@mikejolley :) I may well just do that. I see your point about it being new functionality but we are using it to resolve a problem introduced in 3.5 hence reference to bugs. Looks like our choices are to roll back, patch with this new feature or make our own solution so we will try copying your PR as our first choice.

@tldawson
Copy link

Is there any way to prevent stock change on orders with specific order statuses? I'm reading through the merged commits but I don't see any hooks to change the new functionality.

For example, if an order had a custom status like quote I wouldn't want to change stock until the customer approves the quote (and we change its status to pending).

@Spreeuw
Copy link
Contributor

Spreeuw commented Apr 26, 2019

+1 on filters for preventing stock change on specific order statuses

@LeonWesten
Copy link

LeonWesten commented Apr 29, 2019

Is there any way to prevent stock change on orders with specific order statuses? I'm reading through the merged commits but I don't see any hooks to change the new functionality.

For example, if an order had a custom status like quote I wouldn't want to change stock until the customer approves the quote (and we change its status to pending).

Do you already know how to fix it? Same problem here..

@davidlonguk
Copy link

@LeonWesten We are going to be making our plugin that will restore previous behaviour (so there are stock Up/Down buttons ) as we need it for several of our actions that include disabling a line item but not an entire order so we don't have an order status change. If the community would find it useful we can make it publicly available but it's 6-8 weeks out.

@tldawson
Copy link

tldawson commented Apr 29, 2019

Rather than make a plugin, why not create a PR that adds hooks to this code? If I have time this week, I'll see if I can draft up one.

@LeonWesten
Copy link

Rather than make a plugin, why not create a PR that adds hooks to this code? If I have time this week, I'll see if I can draft up one.

Yes, please..

@davidlonguk
Copy link

@tldawson That sounds great - I hope it is is accepted but I think that woo have plans to go in a different direction with the stock levels automatically changing when you add/remove line items from an order in a future update rather than going back to manual. We require manual as we have cases where line items remain but we need to increase stock.

@tldawson
Copy link

I see no reason why they would reject a thoughtful PR that adds hooks to this code. Hooks are the heart of WordPress and Woocommerce's extensibility.

@LeonWesten
Copy link

Is there already a solution for this problem?

@AKSUTAH
Copy link

AKSUTAH commented Jun 20, 2019

Being able to click and (highlight) multiple items in the order and then increase or decrease stock is essential. Doing them one by one is tedious.
That makes managing orders take way more time and effort.
Sure, keep this feature, but bring the old one back too.

@AKSUTAH
Copy link

AKSUTAH commented Jul 3, 2020

Who do I have to PAY to get the Reduce Stock & Increase Stock Buttons back in the order?
This is getting to the point of extortion. How much do you want to bring this simple necessary feature BACK?
Why was it removed in the first place?

1 similar comment
@AKSUTAH
Copy link

AKSUTAH commented Jul 3, 2020

Who do I have to PAY to get the Reduce Stock & Increase Stock Buttons back in the order?
This is getting to the point of extortion. How much do you want to bring this simple necessary feature BACK?
Why was it removed in the first place?

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

Successfully merging this pull request may close these issues.