Skip to content
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

Can not create creditmemo with not exists products #38062

Closed
5 tasks
oleksiyzestlogic opened this issue Oct 10, 2023 · 16 comments
Closed
5 tasks

Can not create creditmemo with not exists products #38062

oleksiyzestlogic opened this issue Oct 10, 2023 · 16 comments
Assignees
Labels
Issue: needs update Additional information is require, waiting for response Reported on 2.4.6 Indicates original Magento version for the Issue report.

Comments

@oleksiyzestlogic
Copy link

oleksiyzestlogic commented Oct 10, 2023

Preconditions and environment

  • Magento version is 2.4.6
  • MSI

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

  • Severity: S0 - Affects critical data or functionality and leaves users without workaround.
  • Severity: S1 - Affects critical data or functionality and forces users to employ a workaround.
  • Severity: S2 - Affects non-critical data or functionality and forces users to employ a workaround.
  • Severity: S3 - Affects non-critical data or functionality and does not force users to employ a workaround.
  • Severity: S4 - Affects aesthetics, professional look and feel, “quality” or “usability”.
@m2-assistant
Copy link

m2-assistant bot commented Oct 10, 2023

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:


Join Magento Community Engineering Slack and ask your questions in #github channel.
⚠️ According to the Magento Contribution requirements, all issues must go through the Community Contributions Triage process. Community Contributions Triage is a public meeting.
🕙 You can find the schedule on the Magento Community Calendar page.
📞 The triage of issues happens in the queue order. If you want to speed up the delivery of your contribution, join the Community Contributions Triage session to discuss the appropriate ticket.

@oleksiyzestlogic
Copy link
Author

@magento give me 2.4-develop instance

@magento-deployment-service
Copy link

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

@magento-deployment-service
Copy link

@engcom-Bravo engcom-Bravo self-assigned this Oct 10, 2023
@m2-assistant
Copy link

m2-assistant bot commented Oct 10, 2023

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: 👇

  • 1. Verify that issue has all the required information. (Preconditions, Steps to reproduce, Expected result, Actual result).
  • 2. Verify that issue has a meaningful description and provides enough information to reproduce the issue.
  • 3. Add Area: XXXXX label to the ticket, indicating the functional areas it may be related to.
  • 4. Verify that the issue is reproducible on 2.4-develop branch
    Details- Add the comment @magento give me 2.4-develop instance to deploy test instance on Magento infrastructure.
    - If the issue is reproducible on 2.4-develop branch, please, add the label Reproduced on 2.4.x.
    - If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and stop verification process here!
  • 5. Add label Issue: Confirmed once verification is complete.
  • 6. Make sure that automatic system confirms that report has been added to the backlog.

@engcom-Bravo engcom-Bravo added the Reported on 2.4.6 Indicates original Magento version for the Issue report. label Oct 10, 2023
@engcom-Bravo
Copy link
Contributor

@magento give me 2.4-develop instance

@magento-deployment-service
Copy link

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

@magento-deployment-service
Copy link

@engcom-Bravo
Copy link
Contributor

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

  • Add configurable product to cart
  • Place order
  • Change SKU for simple product from new order
  • Create Invoice and Shipping
  • Create Credit Memo
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.

@engcom-Bravo engcom-Bravo added the Issue: needs update Additional information is require, waiting for response label Oct 11, 2023
@oleksiyzestlogic
Copy link
Author

@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 - magento/inventory#3330

@engcom-Bravo
Copy link
Contributor

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

magento/inventory#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
Copy link
Contributor

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
Copy link

@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
Copy link

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

  • Create a configurable with one child
  • Buy this one child and create an invoice for the order
  • Remove the child product from the catalog
  • Try to create a creditmemo for the order

@SamJUK
Copy link

SamJUK commented Apr 5, 2024

@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
Copy link

@SamJUK, no, the issue was kept closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue: needs update Additional information is require, waiting for response Reported on 2.4.6 Indicates original Magento version for the Issue report.
Projects
None yet
Development

No branches or pull requests

4 participants