-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Cannot batch-print invoices from the orders grid #5639
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
Comments
This is a duplicate of an existing issue #4974 which was incorrectly closed, so it's great to see a suggested fix. Hopefully this will get sorted now. I'll give it a test. |
Hi @maderlock, were you able to replicate the issue, and confirm that the suggested fix works? |
The recommended fix on the above post did not work due to an empty collection getting passed into massAction. The issues lies around Magento\Ui\Component\MassAction\Filter. The getCollection function of this class is called within Magento\Sales\Controller\Adminhtml\Order\AbstractMassAction and then this collection is passed into massAction. The issue with what is happening within this getCollection function is that document->getId() returns an order ID, $collection->addFieldToFilter($collection->getIdFieldName(), ['in' => $ids]); is then used, the ID field name being the entity_id. So essentially it ends up filtering an invoice collection by entity IDs, using an array of order IDs. As this is quite an abstract class, the problem most likely revolves around the document itself and what it's ID is set to be. What you end up with is an empty invoice collection by the time you have got to massAction. |
So I'm guessing that this is not fixed in 2.1.1? It's a major sticking point for clients that rely on the order grid to process orders (as seems reasonable). They currently have to move back and forth between the invoice grid for printing and the order grid for other tasks. Given #6438 on top of this, the invoice grid is hard to use itself if you have customers using PayPal. Please please put some effort into these order-related bugs. |
@veloraven, we're approaching the 14-day inactivity cutoff for open issues. Has this issue been replicated by the Magento team? |
@JacobDrummond To be clear the 14-day inactivity applies only to issues where Magento has requested more information in order to reproduce an issue. There is no "needs update" label on this issue which indicates we are still investigating and trying to reproduce-so no inactivity clock running on this one. |
Do we have a fix on this yet? This one is a big problem for any store with significant order volume. |
Can i get an update on this, we have this exact same problem, i've just debugged and the collection being passed is empty. This is when the grid is filtered by status. The Print All mass action seems to be working strangely. This is a significant problem, the needs to be looked at as soon as possible. |
Unfortunately, I could not reproduce the issue as you described it. Can you reproduce this issue on latest version of Magento2? |
Fixed issues: - MC-25132: Fix deadlocks related to crons / consumers
Steps to reproduce
Expected result
Actual result
Problem
$invoicesCollection = $this->collectionFactory->create()->setOrderFilter(['in' => $collection->getAllIds()]);
filters $invoicesCollection with setOrderFilter() using a an array of invoice IDs, not order IDs$invoicesCollection = $this->collectionFactory->create()->addAttributeToFilter('entity_id', ['in' => $collection->getAllIds()]);
.The text was updated successfully, but these errors were encountered: