magento / magento2

Prior to making any Submission(s), you must sign an Adobe Contributor License Agreement, available here at: https://opensource.adobe.com/cla.html. All Submissions you make to Adobe Inc. and its affiliates, assigns and subsidiaries (collectively “Adobe”) are subject to the terms of the Adobe Contributor License Agreement.
http://www.magento.com
Open Software License 3.0
11.5k stars 9.31k forks source link

Unable to create shipping label after creating shipment. #29817

Closed dev-ajaysaini closed 3 years ago

dev-ajaysaini commented 4 years ago

Unable to create shipping label for already shipped order.

Preconditions (*)

  1. Magento 2.4.0
  2. Choose shipping method which have feature to create shipment label.

Steps to reproduce (*)

  1. Place an order with simple product 2.Choose shipping method which have feature to create shipment label.
  2. Do shipment without creating shipping label for the same order.
  3. Go to Shipments and choose shipment and then try to click on create shipping label button after that there it shows already 2 packages fields which can't be remove or unable to add products in to packages. https://prnt.sc/u8y96r also found some issue in console https://nimb.ws/pucMnw

Expected result (*)

  1. Admin should be able to add delete package and order items and create shipment label.

Actual result (*)

  1. https://nimb.ws/pucMnw
  2. https://prnt.sc/u8y96r

Please provide Severity assessment for the Issue as Reporter. This information will help during Confirmation and Issue triage processes.

m2-assistant[bot] commented 4 years ago

Hi @webkul-ajaysaini. Thank you for your report. To help us process this issue please make sure that you provided the following information:

Please make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, please, add a comment to the issue:

@magento give me 2.4-develop instance - upcoming 2.4.x release

For more details, please, review the Magento Contributor Assistant documentation.

Please, add a comment to assign the issue: @magento I am working on this


:clock10: You can find the schedule on the Magento Community Calendar page.

:telephone_receiver: The triage of issues happens in the queue order. If you want to speed up the delivery of your contribution, please join the Community Contributions Triage session to discuss the appropriate ticket.

:movie_camera: You can find the recording of the previous Community Contributions Triage on the Magento Youtube Channel

:pencil2: Feel free to post questions/proposals/feedback related to the Community Contributions Triage process to the corresponding Slack Channel

Vishrootways commented 4 years ago

@webkul-ajaysaini This is knowing issue of Magento 2.4.0. Here is the patch to solve this issue https://support.magento.com/hc/en-us/articles/360046750171-Shipping-labels-creation-known-issue-in-Magento-2-4-0

engcom-Bravo commented 3 years ago

Hello @webkul-ajaysaini

Thank you for your report.

This issue is already fixed in 2.4.1 and 2.4-develop Magento versions Admin is able to create Shipping label, add/delete packages

We are closing this issue. Please feel free to comment, reopen or create a new ticket according to the Issue reporting guidelines

miteshdhaduk commented 3 years ago

@engcom-Bravo Not working in CE Magento2.4.2.

Grid is not open after click on Add Products to Package for already shipped order(UPS shipping method).

No error in console or in var/log folder.

juharintanen commented 2 years ago

@engcom-Bravo Not working in CE Magento2.4.2.

Grid is not open after click on Add Products to Package for already shipped order(UPS shipping method).

No error in console or in var/log folder.

I found out, that in Magento_Shipping::order/packaging/grid.phtml there is a row for fetching Order Item Id.

$id = $item->getId() ?? $item->getOrderItemId();

If you are trying to create label to a order that already has shipment, it's fetching items in sales_shipment_item table, so that row should actually be other way around because now its getting the wrong id.

So: $id = $item->getOrderItemId() ?? $item->getId();

eerohakio commented 2 years ago

@engcom-Bravo Not working in CE Magento2.4.2. Grid is not open after click on Add Products to Package for already shipped order(UPS shipping method). No error in console or in var/log folder.

I found out, that in Magento_Shipping::order/packaging/grid.phtml there is a row for fetching Order Item Id.

$id = $item->getId() ?? $item->getOrderItemId();

If you are trying to create label to a order that already has shipment, it's fetching items in sales_shipment_item table, so that row should actually be other way around because now its getting the wrong id.

So: $id = $item->getOrderItemId() ?? $item->getId();

As @juharintanen mentioned this is valid. Tested also in Magento 2.4.3-p1. With the fix mentioned got the thing working.