File tree Expand file tree Collapse file tree 2 files changed +10
-0
lines changed
app/code/Magento/Sales/Model/Order
Creditmemo/Item/Validation Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -53,6 +53,10 @@ public function validate($entity)
53
53
return [__ ('The creditmemo contains product item that is not part of the original order. ' )];
54
54
}
55
55
56
+ if ($ orderItem ->isDummy ()) {
57
+ return [__ ('The creditmemo contains incorrect product items. ' )];
58
+ }
59
+
56
60
if (!$ this ->isQtyAvailable ($ orderItem , $ entity ->getQty ())) {
57
61
return [__ ('The quantity to refund must not be greater than the unrefunded quantity. ' )];
58
62
}
Original file line number Diff line number Diff line change @@ -228,6 +228,12 @@ private function addParentItem(OrderItemInterface $orderItem)
228
228
{
229
229
if ($ parentId = $ orderItem ->getParentItemId ()) {
230
230
$ orderItem ->setParentItem ($ this ->get ($ parentId ));
231
+ } else {
232
+ foreach ($ orderItem ->getOrder ()->getAllItems () as $ item ) {
233
+ if ($ item ->getParentItemId () === $ orderItem ->getItemId ()) {
234
+ $ item ->setParentItem ($ orderItem );
235
+ }
236
+ }
231
237
}
232
238
}
233
239
You can’t perform that action at this time.
0 commit comments