magento / inventory

Magento Inventory Project (a.k.a MSI)
Open Software License 3.0
337 stars 248 forks source link

Exception in Low stock report for product with another name on additional storeview #737

Closed smoskaluk closed 6 years ago

smoskaluk commented 6 years ago

Preconditions

  1. Magento MSI
  2. Create new stock with new source
  3. Create new Stroview
  4. Create simple product and assign it to both sources with Qty = 10 and Notify Quantity = 11
  5. Change product's name for new Storeview and save the product

Steps to reproduce

  1. Open Low stock report

Expected result

  1. Low stock report should be created correctly

Actual result

  1. [Screenshot, logs]1 exception(s): Exception #0 (Exception): Item (Magento\Inventory\Model\SourceItem) with the same ID "1" already exists.

Exception #0 (Exception): Item (Magento\Inventory\Model\SourceItem) with the same ID "1" already exists.

0 /var/www/html/magento2ce/msi8/lib/internal/Magento/Framework/Data/Collection/AbstractDb.php(584): Magento\Framework\Data\Collection->addItem(Object(Magento\Inventory\Model\SourceItem))

1 /var/www/html/magento2ce/msi8/lib/internal/Magento/Framework/Data/Collection/AbstractDb.php(559): Magento\Framework\Data\Collection\AbstractDb->loadWithFilter(false, false)

2 /var/www/html/magento2ce/msi8/lib/internal/Magento/Framework/Data/Collection.php(831): Magento\Framework\Data\Collection\AbstractDb->load()

3 /var/www/html/magento2ce/msi8/app/code/Magento/Backend/view/adminhtml/templates/widget/grid/column_set.phtml(53): Magento\Framework\Data\Collection->getIterator()

4 /var/www/html/magento2ce/msi8/lib/internal/Magento/Framework/View/TemplateEngine/Php.php(59): include('/var/www/html/m...')

5 /var/www/html/magento2ce/msi8/lib/internal/Magento/Framework/View/Element/Template.php(270): Magento\Framework\View\TemplateEngine\Php->render(Object(Magento\Backend\Block\Widget\Grid\ColumnSet), '/var/www/html/m...', Array)

6 /var/www/html/magento2ce/msi8/lib/internal/Magento/Framework/View/Element/Template.php(300): Magento\Framework\View\Element\Template->fetchView('/var/www/html/m...')

7 /var/www/html/magento2ce/msi8/lib/internal/Magento/Framework/View/Element/AbstractBlock.php(667): Magento\Framework\View\Element\Template->_toHtml()

8 /var/www/html/magento2ce/msi8/lib/internal/Magento/Framework/View/Layout.php(558): Magento\Framework\View\Element\AbstractBlock->toHtml()

9 /var/www/html/magento2ce/msi8/lib/internal/Magento/Framework/View/Layout.php(534): Magento\Framework\View\Layout->_renderBlock('adminhtml.block...')

10 /var/www/html/magento2ce/msi8/generated/code/Magento/Framework/View/Layout/Interceptor.php(206): Magento\Framework\View\Layout->renderNonCachedElement('adminhtml.block...')

11 /var/www/html/magento2ce/msi8/lib/internal/Magento/Framework/View/Layout.php(489): Magento\Framework\View\Layout\Interceptor->renderNonCachedElement('adminhtml.block...')

12 /var/www/html/magento2ce/msi8/generated/code/Magento/Framework/View/Layout/Interceptor.php(193): Magento\Framework\View\Layout->renderElement('adminhtml.block...', true)

13 /var/www/html/magento2ce/msi8/lib/internal/Magento/Framework/View/Element/AbstractBlock.php(507): Magento\Framework\View\Layout\Interceptor->renderElement('adminhtml.block...', true)

14 /var/www/html/magento2ce/msi8/app/code/Magento/Backend/view/adminhtml/templates/widget/grid.phtml(133): Magento\Framework\View\Element\AbstractBlock->getChildHtml('grid.columnSet')

15 /var/www/html/magento2ce/msi8/lib/internal/Magento/Framework/View/TemplateEngine/Php.php(59): include('/var/www/html/m...')

16 /var/www/html/magento2ce/msi8/lib/internal/Magento/Framework/View/Element/Template.php(270): Magento\Framework\View\TemplateEngine\Php->render(Object(Magento\InventoryLowQuantityNotification\Block\Adminhtml\Product\Lowstock\Grid), '/var/www/html/m...', Array)

17 /var/www/html/magento2ce/msi8/lib/internal/Magento/Framework/View/Element/Template.php(300): Magento\Framework\View\Element\Template->fetchView('/var/www/html/m...')

18 /var/www/html/magento2ce/msi8/app/code/Magento/Backend/Block/Template.php(124): Magento\Framework\View\Element\Template->_toHtml()

19 /var/www/html/magento2ce/msi8/lib/internal/Magento/Framework/View/Element/AbstractBlock.php(667): Magento\Backend\Block\Template->_toHtml()

20 /var/www/html/magento2ce/msi8/lib/internal/Magento/Framework/View/Layout.php(558): Magento\Framework\View\Element\AbstractBlock->toHtml()

21 /var/www/html/magento2ce/msi8/lib/internal/Magento/Framework/View/Layout.php(534): Magento\Framework\View\Layout->_renderBlock('adminhtml.block...')

22 /var/www/html/magento2ce/msi8/generated/code/Magento/Framework/View/Layout/Interceptor.php(206): Magento\Framework\View\Layout->renderNonCachedElement('adminhtml.block...')

23 /var/www/html/magento2ce/msi8/lib/internal/Magento/Framework/View/Layout.php(489): Magento\Framework\View\Layout\Interceptor->renderNonCachedElement('adminhtml.block...')

24 /var/www/html/magento2ce/msi8/generated/code/Magento/Framework/View/Layout/Interceptor.php(193): Magento\Framework\View\Layout->renderElement('adminhtml.block...', true)

25 /var/www/html/magento2ce/msi8/lib/internal/Magento/Framework/View/Element/AbstractBlock.php(507): Magento\Framework\View\Layout\Interceptor->renderElement('adminhtml.block...', true)

26 /var/www/html/magento2ce/msi8/app/code/Magento/Backend/Block/Widget/Grid/Container.php(119): Magento\Framework\View\Element\AbstractBlock->getChildHtml('grid')

27 /var/www/html/magento2ce/msi8/app/code/Magento/Backend/view/adminhtml/templates/widget/grid/container.phtml(13): Magento\Backend\Block\Widget\Grid\Container->getGridHtml()

28 /var/www/html/magento2ce/msi8/lib/internal/Magento/Framework/View/TemplateEngine/Php.php(59): include('/var/www/html/m...')

29 /var/www/html/magento2ce/msi8/lib/internal/Magento/Framework/View/Element/Template.php(270): Magento\Framework\View\TemplateEngine\Php->render(Object(Magento\Reports\Block\Adminhtml\Product\Lowstock), '/var/www/html/m...', Array)

30 /var/www/html/magento2ce/msi8/lib/internal/Magento/Framework/View/Element/Template.php(300): Magento\Framework\View\Element\Template->fetchView('/var/www/html/m...')

31 /var/www/html/magento2ce/msi8/app/code/Magento/Backend/Block/Template.php(124): Magento\Framework\View\Element\Template->_toHtml()

32 /var/www/html/magento2ce/msi8/lib/internal/Magento/Framework/View/Element/AbstractBlock.php(667): Magento\Backend\Block\Template->_toHtml()

33 /var/www/html/magento2ce/msi8/lib/internal/Magento/Framework/View/Layout.php(558): Magento\Framework\View\Element\AbstractBlock->toHtml()

34 /var/www/html/magento2ce/msi8/lib/internal/Magento/Framework/View/Layout.php(534): Magento\Framework\View\Layout->_renderBlock('adminhtml.repor...')

35 /var/www/html/magento2ce/msi8/generated/code/Magento/Framework/View/Layout/Interceptor.php(206): Magento\Framework\View\Layout->renderNonCachedElement('adminhtml.repor...')

36 /var/www/html/magento2ce/msi8/lib/internal/Magento/Framework/View/Layout.php(489): Magento\Framework\View\Layout\Interceptor->renderNonCachedElement('adminhtml.repor...')

37 /var/www/html/magento2ce/msi8/generated/code/Magento/Framework/View/Layout/Interceptor.php(193): Magento\Framework\View\Layout->renderElement('adminhtml.repor...', false)

38 /var/www/html/magento2ce/msi8/lib/internal/Magento/Framework/View/Layout.php(586): Magento\Framework\View\Layout\Interceptor->renderElement('adminhtml.repor...', false)

39 /var/www/html/magento2ce/msi8/lib/internal/Magento/Framework/View/Layout.php(536): Magento\Framework\View\Layout->_renderContainer('content', false)

40 /var/www/html/magento2ce/msi8/generated/code/Magento/Framework/View/Layout/Interceptor.php(206): Magento\Framework\View\Layout->renderNonCachedElement('content')

41 /var/www/html/magento2ce/msi8/lib/internal/Magento/Framework/View/Layout.php(489): Magento\Framework\View\Layout\Interceptor->renderNonCachedElement('content')

42 /var/www/html/magento2ce/msi8/generated/code/Magento/Framework/View/Layout/Interceptor.php(193): Magento\Framework\View\Layout->renderElement('content', false)

43 /var/www/html/magento2ce/msi8/lib/internal/Magento/Framework/View/Layout.php(586): Magento\Framework\View\Layout\Interceptor->renderElement('content', false)

44 /var/www/html/magento2ce/msi8/lib/internal/Magento/Framework/View/Layout.php(536): Magento\Framework\View\Layout->_renderContainer('main.col', false)

45 /var/www/html/magento2ce/msi8/generated/code/Magento/Framework/View/Layout/Interceptor.php(206): Magento\Framework\View\Layout->renderNonCachedElement('main.col')

46 /var/www/html/magento2ce/msi8/lib/internal/Magento/Framework/View/Layout.php(489): Magento\Framework\View\Layout\Interceptor->renderNonCachedElement('main.col')

47 /var/www/html/magento2ce/msi8/generated/code/Magento/Framework/View/Layout/Interceptor.php(193): Magento\Framework\View\Layout->renderElement('main.col', false)

48 /var/www/html/magento2ce/msi8/lib/internal/Magento/Framework/View/Layout.php(586): Magento\Framework\View\Layout\Interceptor->renderElement('main.col', false)

49 /var/www/html/magento2ce/msi8/lib/internal/Magento/Framework/View/Layout.php(536): Magento\Framework\View\Layout->_renderContainer('admin.scope.col...', false)

50 /var/www/html/magento2ce/msi8/generated/code/Magento/Framework/View/Layout/Interceptor.php(206): Magento\Framework\View\Layout->renderNonCachedElement('admin.scope.col...')

51 /var/www/html/magento2ce/msi8/lib/internal/Magento/Framework/View/Layout.php(489): Magento\Framework\View\Layout\Interceptor->renderNonCachedElement('admin.scope.col...')

52 /var/www/html/magento2ce/msi8/generated/code/Magento/Framework/View/Layout/Interceptor.php(193): Magento\Framework\View\Layout->renderElement('admin.scope.col...', false)

53 /var/www/html/magento2ce/msi8/lib/internal/Magento/Framework/View/Layout.php(586): Magento\Framework\View\Layout\Interceptor->renderElement('admin.scope.col...', false)

54 /var/www/html/magento2ce/msi8/lib/internal/Magento/Framework/View/Layout.php(536): Magento\Framework\View\Layout->_renderContainer('page.main.conta...', false)

55 /var/www/html/magento2ce/msi8/generated/code/Magento/Framework/View/Layout/Interceptor.php(206): Magento\Framework\View\Layout->renderNonCachedElement('page.main.conta...')

56 /var/www/html/magento2ce/msi8/lib/internal/Magento/Framework/View/Layout.php(489): Magento\Framework\View\Layout\Interceptor->renderNonCachedElement('page.main.conta...')

57 /var/www/html/magento2ce/msi8/generated/code/Magento/Framework/View/Layout/Interceptor.php(193): Magento\Framework\View\Layout->renderElement('page.main.conta...', false)

58 /var/www/html/magento2ce/msi8/lib/internal/Magento/Framework/View/Layout.php(586): Magento\Framework\View\Layout\Interceptor->renderElement('page.main.conta...', false)

59 /var/www/html/magento2ce/msi8/lib/internal/Magento/Framework/View/Layout.php(536): Magento\Framework\View\Layout->_renderContainer('page.content', false)

60 /var/www/html/magento2ce/msi8/generated/code/Magento/Framework/View/Layout/Interceptor.php(206): Magento\Framework\View\Layout->renderNonCachedElement('page.content')

61 /var/www/html/magento2ce/msi8/lib/internal/Magento/Framework/View/Layout.php(489): Magento\Framework\View\Layout\Interceptor->renderNonCachedElement('page.content')

62 /var/www/html/magento2ce/msi8/generated/code/Magento/Framework/View/Layout/Interceptor.php(193): Magento\Framework\View\Layout->renderElement('page.content', false)

63 /var/www/html/magento2ce/msi8/lib/internal/Magento/Framework/View/Layout.php(586): Magento\Framework\View\Layout\Interceptor->renderElement('page.content', false)

64 /var/www/html/magento2ce/msi8/lib/internal/Magento/Framework/View/Layout.php(536): Magento\Framework\View\Layout->_renderContainer('page.wrapper', false)

65 /var/www/html/magento2ce/msi8/generated/code/Magento/Framework/View/Layout/Interceptor.php(206): Magento\Framework\View\Layout->renderNonCachedElement('page.wrapper')

66 /var/www/html/magento2ce/msi8/lib/internal/Magento/Framework/View/Layout.php(489): Magento\Framework\View\Layout\Interceptor->renderNonCachedElement('page.wrapper')

67 /var/www/html/magento2ce/msi8/generated/code/Magento/Framework/View/Layout/Interceptor.php(193): Magento\Framework\View\Layout->renderElement('page.wrapper', false)

68 /var/www/html/magento2ce/msi8/lib/internal/Magento/Framework/View/Layout.php(586): Magento\Framework\View\Layout\Interceptor->renderElement('page.wrapper', false)

69 /var/www/html/magento2ce/msi8/lib/internal/Magento/Framework/View/Layout.php(536): Magento\Framework\View\Layout->_renderContainer('backend.page', false)

70 /var/www/html/magento2ce/msi8/generated/code/Magento/Framework/View/Layout/Interceptor.php(206): Magento\Framework\View\Layout->renderNonCachedElement('backend.page')

71 /var/www/html/magento2ce/msi8/lib/internal/Magento/Framework/View/Layout.php(489): Magento\Framework\View\Layout\Interceptor->renderNonCachedElement('backend.page')

72 /var/www/html/magento2ce/msi8/generated/code/Magento/Framework/View/Layout/Interceptor.php(193): Magento\Framework\View\Layout->renderElement('backend.page', false)

73 /var/www/html/magento2ce/msi8/lib/internal/Magento/Framework/View/Layout.php(586): Magento\Framework\View\Layout\Interceptor->renderElement('backend.page', false)

74 /var/www/html/magento2ce/msi8/lib/internal/Magento/Framework/View/Layout.php(536): Magento\Framework\View\Layout->_renderContainer('root', false)

75 /var/www/html/magento2ce/msi8/generated/code/Magento/Framework/View/Layout/Interceptor.php(206): Magento\Framework\View\Layout->renderNonCachedElement('root')

76 /var/www/html/magento2ce/msi8/lib/internal/Magento/Framework/View/Layout.php(489): Magento\Framework\View\Layout\Interceptor->renderNonCachedElement('root')

77 /var/www/html/magento2ce/msi8/generated/code/Magento/Framework/View/Layout/Interceptor.php(193): Magento\Framework\View\Layout->renderElement('root', true)

78 /var/www/html/magento2ce/msi8/lib/internal/Magento/Framework/View/Layout.php(955): Magento\Framework\View\Layout\Interceptor->renderElement('root')

79 /var/www/html/magento2ce/msi8/generated/code/Magento/Framework/View/Layout/Interceptor.php(492): Magento\Framework\View\Layout->getOutput()

80 /var/www/html/magento2ce/msi8/lib/internal/Magento/Framework/View/Result/Page.php(257): Magento\Framework\View\Layout\Interceptor->getOutput()

81 /var/www/html/magento2ce/msi8/lib/internal/Magento/Framework/View/Result/Layout.php(170): Magento\Framework\View\Result\Page->render(Object(Magento\Framework\App\Response\Http\Interceptor))

82 /var/www/html/magento2ce/msi8/generated/code/Magento/Backend/Model/View/Result/Page/Interceptor.php(193): Magento\Framework\View\Result\Layout->renderResult(Object(Magento\Framework\App\Response\Http\Interceptor))

83 /var/www/html/magento2ce/msi8/lib/internal/Magento/Framework/App/View.php(221): Magento\Backend\Model\View\Result\Page\Interceptor->renderResult(Object(Magento\Framework\App\Response\Http\Interceptor))

84 /var/www/html/magento2ce/msi8/app/code/Magento/Reports/Controller/Adminhtml/Report/Product/Lowstock.php(32): Magento\Framework\App\View->renderLayout()

85 /var/www/html/magento2ce/msi8/generated/code/Magento/Reports/Controller/Adminhtml/Report/Product/Lowstock/Interceptor.php(24): Magento\Reports\Controller\Adminhtml\Report\Product\Lowstock->execute()

86 /var/www/html/magento2ce/msi8/lib/internal/Magento/Framework/App/Action/Action.php(107): Magento\Reports\Controller\Adminhtml\Report\Product\Lowstock\Interceptor->execute()

87 /var/www/html/magento2ce/msi8/app/code/Magento/Backend/App/AbstractAction.php(229): Magento\Framework\App\Action\Action->dispatch(Object(Magento\Framework\App\Request\Http))

88 /var/www/html/magento2ce/msi8/lib/internal/Magento/Framework/Interception/Interceptor.php(58): Magento\Backend\App\AbstractAction->dispatch(Object(Magento\Framework\App\Request\Http))

89 /var/www/html/magento2ce/msi8/lib/internal/Magento/Framework/Interception/Interceptor.php(138): Magento\Reports\Controller\Adminhtml\Report\Product\Lowstock\Interceptor->___callParent('dispatch', Array)

90 /var/www/html/magento2ce/msi8/app/code/Magento/Backend/App/Action/Plugin/Authentication.php(143): Magento\Reports\Controller\Adminhtml\Report\Product\Lowstock\Interceptor->Magento\Framework\Interception{closure}(Object(Magento\Framework\App\Request\Http))

91 /var/www/html/magento2ce/msi8/lib/internal/Magento/Framework/Interception/Interceptor.php(135): Magento\Backend\App\Action\Plugin\Authentication->aroundDispatch(Object(Magento\Reports\Controller\Adminhtml\Report\Product\Lowstock\Interceptor), Object(Closure), Object(Magento\Framework\App\Request\Http))

92 /var/www/html/magento2ce/msi8/lib/internal/Magento/Framework/Interception/Interceptor.php(153): Magento\Reports\Controller\Adminhtml\Report\Product\Lowstock\Interceptor->Magento\Framework\Interception{closure}(Object(Magento\Framework\App\Request\Http))

93 /var/www/html/magento2ce/msi8/generated/code/Magento/Reports/Controller/Adminhtml/Report/Product/Lowstock/Interceptor.php(65): Magento\Reports\Controller\Adminhtml\Report\Product\Lowstock\Interceptor->___callPlugins('dispatch', Array, NULL)

94 /var/www/html/magento2ce/msi8/lib/internal/Magento/Framework/App/FrontController.php(55): Magento\Reports\Controller\Adminhtml\Report\Product\Lowstock\Interceptor->dispatch(Object(Magento\Framework\App\Request\Http))

95 /var/www/html/magento2ce/msi8/lib/internal/Magento/Framework/Interception/Interceptor.php(58): Magento\Framework\App\FrontController->dispatch(Object(Magento\Framework\App\Request\Http))

96 /var/www/html/magento2ce/msi8/lib/internal/Magento/Framework/Interception/Interceptor.php(138): Magento\Framework\App\FrontController\Interceptor->___callParent('dispatch', Array)

97 /var/www/html/magento2ce/msi8/lib/internal/Magento/Framework/Interception/Interceptor.php(153): Magento\Framework\App\FrontController\Interceptor->Magento\Framework\Interception{closure}(Object(Magento\Framework\App\Request\Http))

98 /var/www/html/magento2ce/msi8/generated/code/Magento/Framework/App/FrontController/Interceptor.php(26): Magento\Framework\App\FrontController\Interceptor->___callPlugins('dispatch', Array, Array)

99 /var/www/html/magento2ce/msi8/lib/internal/Magento/Framework/App/Http.php(135): Magento\Framework\App\FrontController\Interceptor->dispatch(Object(Magento\Framework\App\Request\Http))

100 /var/www/html/magento2ce/msi8/generated/code/Magento/Framework/App/Http/Interceptor.php(24): Magento\Framework\App\Http->launch()

101 /var/www/html/magento2ce/msi8/lib/internal/Magento/Framework/App/Bootstrap.php(256): Magento\Framework\App\Http\Interceptor->launch()

102 /var/www/html/magento2ce/msi8/index.php(39): Magento\Framework\App\Bootstrap->run(Object(Magento\Framework\App\Http\Interceptor))

103 {main}

naydav commented 6 years ago

https://github.com/magento-engcom/msi/pull/752