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.56k stars 9.32k forks source link

Can not create creditmemo with not exists products #38062

Closed oleksiyzestlogic closed 1 year ago

oleksiyzestlogic commented 1 year ago

Preconditions and environment

Steps to reproduce

Add configurable product to cart Place order Change SKU for simple product from new order Create Invoice and Shipping Create Credit Memo

Expected result

New credit memo page loaded and admin can create credit memo

Actual result

Credit memo page is broken Issue in logs: main.CRITICAL: TypeError: Magento\InventoryConfiguration\Model\IsSourceItemManagementAllowedForProductType\Interceptor::execute(): Argument #1 ($productType) must be of type string, null given, called in /vendor/magento/module-inventory-sales/Model/GetProductSalableQty.php on line 108

Additional information

No response

Release note

No response

Triage and priority

m2-assistant[bot] commented 1 year ago

Hi @oleksiyzestlogic. Thank you for your report. To speed up processing of this issue, make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, Add a comment to the issue:

oleksiyzestlogic commented 1 year ago

@magento give me 2.4-develop instance

magento-deployment-service[bot] commented 1 year ago

Hi @oleksiyzestlogic. Thank you for your request. I'm working on Magento instance for you.

magento-deployment-service[bot] commented 1 year ago

Hi @oleksiyzestlogic, here is your Magento Instance: https://bb072509e9438f51d2b9efc623f59bb7.instances-prod.magento-community.engineering Admin access: https://bb072509e9438f51d2b9efc623f59bb7.instances-prod.magento-community.engineering/admin_93de Login: badf4f8b Password: ec1995dcdfd2

m2-assistant[bot] commented 1 year ago

Hi @engcom-Bravo. Thank you for working on this issue. In order to make sure that issue has enough information and ready for development, please read and check the following instruction: :point_down:

engcom-Bravo commented 1 year ago

@magento give me 2.4-develop instance

magento-deployment-service[bot] commented 1 year ago

Hi @engcom-Bravo. Thank you for your request. I'm working on Magento instance for you.

magento-deployment-service[bot] commented 1 year ago

Hi @engcom-Bravo, here is your Magento Instance: https://bb072509e9438f51d2b9efc623f59bb7.instances-prod.magento-community.engineering Admin access: https://bb072509e9438f51d2b9efc623f59bb7.instances-prod.magento-community.engineering/admin_98f9 Login: b9c2471a Password: d29a0af25291

engcom-Bravo commented 1 year ago

Hi @oleksiyzestlogic,

Thank you for reporting and collaboration.

Verified the issue on Magento 2.4-develop instance and the issue is not reproducible. Kindly refer the screenshots.

Steps to reproduce

Screenshot 2023-10-11 at 12 26 47 PM Screenshot 2023-10-11 at 12 26 56 PM

We are able to do invoice and Credit memo after changing the product SKU.But for Shipment we are getting below error

Screenshot 2023-10-11 at 12 28 55 PM

Could you please let us know if we are missing anything.

Thanks.

oleksiyzestlogic commented 1 year ago

@engcom-Bravo thank you for your review We do not have MSI on this Magento instance.

As you can see in description issue in log file is: main.CRITICAL: TypeError: **Magento\InventoryConfiguration**\Model\IsSourceItemManagementAllowedForProductType\Interceptor::execute(): Argument https://github.com/magento/magento2/issues/1 ($productType) must be of type string, null given, called in /vendor/magento/module-inventory-sales/Model/GetProductSalableQty.php on line 108

Sure MSI is a separate project, But I have MSI after I install Magento out of the box. Similar (but not the same) issue has been reported in MSI repo - https://github.com/magento/inventory/issues/3330

engcom-Bravo commented 1 year ago

Hi @oleksiyzestlogic,

Thanks for your update.

Verified the issue on Magento 2.4-develop instance and the issue is not reproducible.Kindly refer the screenshots.

We have verified the issue with MSI and Without MSI we are able to create Invoice and creditmemo.

Without MSI:

Screenshot 2023-10-12 at 12 13 08 PM Screenshot 2023-10-12 at 12 13 14 PM

With MSI :

Screenshot 2023-10-11 at 12 26 47 PM Screenshot 2023-10-11 at 12 26 56 PM

https://github.com/magento/inventory/issues/3330 this issue has been different.

So i request to you to please try to reproduce the issue in Magento 2.4-develop Instance.

Thanks.

engcom-Bravo commented 1 year ago

Hi @oleksiyzestlogic,

We have noticed that this issue has not been updated since long time.
Hence we assume that this issue is fixed now, so we are closing it. Please feel to raise a fresh ticket or reopen this ticket if you need more assistance on this.

Thanks.

norgeindian commented 11 months ago

@engcom-Bravo , we have the same issue, but when the bought child product has been removed in the meantime. Could you please check at which point your call stack differs?

2023-11-22T13:10:39.318418+00:00] .CRITICAL: TypeError: Magento\InventoryConfiguration\Model\IsSourceItemManagementAllowedForProductType\Interceptor::execute(): Argument #1 ($productType) must be of type string, null given, called in /var/www/share/example.url/releases/329/vendor/magento/module-inventory-sales/Model/GetProductSalableQty.php on line 108 and defined in /var/www/share/example.url/releases/329/generated/code/Magento/InventoryConfiguration/Model/IsSourceItemManagementAllowedForProductType/Interceptor.php:45
Stack trace:
#0 /var/www/share/example.url/releases/329/vendor/magento/module-inventory-sales/Model/GetProductSalableQty.php(108): Magento\InventoryConfiguration\Model\IsSourceItemManagementAllowedForProductType\Interceptor->execute(NULL)
#1 /var/www/share/example.url/releases/329/vendor/magento/module-inventory-sales/Model/GetProductSalableQty.php(75): Magento\InventorySales\Model\GetProductSalableQty->validateProductType('12345.11')
#2 /var/www/share/example.url/releases/329/vendor/magento/module-inventory-sales-admin-ui/Model/GetSalableQuantityDataBySku.php(105): Magento\InventorySales\Model\GetProductSalableQty->execute('12345.11', 2)
#3 /var/www/share/example.url/releases/329/vendor/magento/module-inventory-sales-admin-ui/Model/GetIsManageStockForProduct.php(95): Magento\InventorySalesAdminUi\Model\GetSalableQuantityDataBySku->execute('12345.11)
#4 /var/www/share/example.url/releases/329/vendor/magento/module-inventory-sales-admin-ui/Model/GetIsManageStockForProduct.php(66): Magento\InventorySalesAdminUi\Model\GetIsManageStockForProduct->getProductStockIds('12345.11)
#5 /var/www/share/example.url/releases/329/vendor/magento/module-inventory-sales-admin-ui/Plugin/Sales/Block/Items/Renderer/DefaultRenderer/ChildManageStockIsOn.php(59): Magento\InventorySalesAdminUi\Model\GetIsManageStockForProduct->execute('12345.11', 'en')

In this scenario 12345.11 is the SKU of the child product.

norgeindian commented 11 months ago

@engcom-Bravo , I just tested on a clean Magento instance. It is actually reproducible:

SamJUK commented 7 months ago

@engcom-Bravo @norgeindian Was there any outcome to this? We are seeing the same issue on a few stores.

[2024-04-05T13:10:03.541722+00:00] main.CRITICAL: TypeError: Magento\InventoryConfiguration\Model\IsSourceItemManagementAllowedForProductType\Interceptor::execute(): Argument #1 ($productType) must be of type string, null given, called in /vendor/magento/module-inventory-sales/Model/GetProductSalableQty.php on line 108 and defined in /generated/code/Magento/InventoryConfiguration/Model/IsSourceItemManagementAllowedForProductType/Interceptor.php:20
Stack trace:
#0 /vendor/magento/module-inventory-sales/Model/GetProductSalableQty.php(108): Magento\InventoryConfiguration\Model\IsSourceItemManagementAllowedForProductType\Interceptor->execute()
#1 /vendor/magento/module-inventory-sales/Model/GetProductSalableQty.php(75): Magento\InventorySales\Model\GetProductSalableQty->validateProductType()
#2 /vendor/magento/module-inventory-sales-admin-ui/Model/GetSalableQuantityDataBySku.php(105): Magento\InventorySales\Model\GetProductSalableQty->execute()
#3 /vendor/magento/module-inventory-sales-admin-ui/Model/GetIsManageStockForProduct.php(95): Magento\InventorySalesAdminUi\Model\GetSalableQuantityDataBySku->execute()
#4 /vendor/magento/module-inventory-sales-admin-ui/Model/GetIsManageStockForProduct.php(66): Magento\InventorySalesAdminUi\Model\GetIsManageStockForProduct->getProductStockIds()
#5 /vendor/magento/module-inventory-sales-admin-ui/Plugin/Sales/Block/Items/Renderer/DefaultRenderer/ChildManageStockIsOn.php(59): Magento\InventorySalesAdminUi\Model\GetIsManageStockForProduct->execute()
#6 /vendor/magento/framework/Interception/Interceptor.php(146): Magento\InventorySalesAdminUi\Plugin\Sales\Block\Items\Renderer\DefaultRenderer\ChildManageStockIsOn->afterCanReturnItemToStock()
#7 /vendor/magento/framework/Interception/Interceptor.php(153): Magento\Sales\Block\Adminhtml\Items\Renderer\DefaultRenderer\Interceptor->Magento\Framework\Interception\{closure}()
#8 /generated/code/Magento/Sales/Block/Adminhtml/Items/Renderer/DefaultRenderer/Interceptor.php(23): Magento\Sales\Block\Adminhtml\Items\Renderer\DefaultRenderer\Interceptor->___callPlugins()
#9 /var/view_preprocessed/pub/static/vendor/magento/module-sales/view/adminhtml/templates/order/creditmemo/create/items/renderer/default.phtml(1): Magento\Sales\Block\Adminhtml\Items\Renderer\DefaultRenderer\Interceptor->canReturnItemToStock()
norgeindian commented 7 months ago

@SamJUK, no, the issue was kept closed.