MDVA-36572: クレジット・メモの更新後に作成された新規在庫引当

影響を受ける製品とバージョン

Adobe Commerce バージョン用のパッチが作成されます。
クラウドインフラストラクチャー 2.4.1 上のAdobe Commerce

Adobe Commerce バージョンとの互換性:

Adobe Commerce(すべてのデプロイメントタイプ) 2.3.5-2.4.2-p1

NOTE
パッチは、新しい Quality Patches Tool リリースを使用する他のバージョンにも適用される可能性があります。 パッチがAdobe Commerceのバージョンと互換性があるかどうかを確認するには、magento/quality-patches パッケージを最新バージョンに更新し、Quality Patches Tool: Search for patches page で互換性を確認します。 パッチ ID を検索キーワードとして使用して、パッチを見つけます。

問題

クレジットメモ予約更新オブザーバーは、クレジットメモが更新されるたびにトリガーされます。 発注との契約に従い、作成されたクレジット・メモでのみトリガーされるように予約更新のロジックが変更されました。 API を介したクレジットメモの編集の可能性は、PO によっても個別のチケットの範囲で確認されます。

再現手順 :

  1. 顧客アカウントを作成します。

  2. シンプルな製品を作成します。

  3. 注文の新しい注文、請求書、およびクレジット メモを作成します。

  4. 新しい統合を作成します。

  5. inventory_reservation テーブルを確認します。

    code language-sql
        select * from inventory_reservation;
        +----------------+----------+----------+----------+-------------------------------------------------------------------------------------------------------------+
        | reservation_id | stock_id | sku      | quantity | metadata                                                                                                    |
        +----------------+----------+----------+----------+-------------------------------------------------------------------------------------------------------------+
        |              1 |        1 | simple_1 |  -1.0000 | {"event_type":"order_placed","object_type":"order","object_id":"","object_increment_id":"000000001"}        |
        |              2 |        1 | simple_1 |   1.0000 | {"event_type":"creditmemo_created","object_type":"order","object_id":"1","object_increment_id":"000000001"} |
        +----------------+----------+----------+----------+-------------------------------------------------------------------------------------------------------------+
        2 rows in set (0.00 sec)
    
  6. GET要求の送信先:../rest/default/V1/creditmemo/3

  7. 応答をコピー(例):

    code language-json
        {
        "adjustment": 0,
        "adjustment_negative": 0,
        "adjustment_positive": 0,
        "base_adjustment": 0,
        "base_adjustment_negative": 0,
        "base_adjustment_positive": 0,
        "base_currency_code": "USD",
        "base_discount_amount": 0,
        "base_grand_total": 105,
        "base_discount_tax_compensation_amount": 0,
        "base_shipping_amount": 5,
        "base_shipping_incl_tax": 5,
        "base_shipping_tax_amount": 0,
        "base_subtotal": 100,
        "base_subtotal_incl_tax": 100,
        "base_tax_amount": 0,
        "base_to_global_rate": 1,
        "base_to_order_rate": 1,
        "billing_address_id": 2,
        "created_at": "2021-04-05 23:43:45",
        "discount_amount": 0,
        "entity_id": 1,
        "global_currency_code": "USD",
        "grand_total": 105,
        "discount_tax_compensation_amount": 0,
        "increment_id": "000000001",
        "order_currency_code": "USD",
        "order_id": 1,
        "shipping_address_id": 1,
        "shipping_amount": 5,
        "shipping_incl_tax": 5,
        "shipping_tax_amount": 0,
        "state": 2,
        "store_currency_code": "USD",
        "store_id": 1,
        "store_to_base_rate": 0,
        "store_to_order_rate": 0,
        "subtotal": 100,
        "subtotal_incl_tax": 100,
        "tax_amount": 0,
        "updated_at": "2021-04-05 23:43:45",
        "items": [
         {
             "base_cost": null,
             "base_discount_tax_compensation_amount": 0,
             "base_price": 100,
             "base_price_incl_tax": 100,
             "base_row_total": 100,
             "base_row_total_incl_tax": 100,
             "base_tax_amount": 0,
             "base_weee_tax_row_disposition": 0,
             "entity_id": 1,
             "discount_tax_compensation_amount": 0,
             "name": "simple_1",
             "order_item_id": 1,
             "parent_id": 1,
             "price": 100,
             "price_incl_tax": 100,
             "product_id": 1,
             "qty": 1,
             "row_total": 100,
             "row_total_incl_tax": 100,
             "sku": "simple_1",
             "tax_amount": 0,
             "weee_tax_applied": "[]",
             "weee_tax_applied_row_amount": 0,
             "weee_tax_row_disposition": 0
         }
        ],
        "comments": []
       }
    
  8. POST要求の送信先:../rest/default/V1/creditmemo

    code language-json
        {
        "entity":
         --paste full response from previous step here--
        }
    
    note note
    NOTE
    このようなペイロードは再生を簡素化するためにのみ使用されます。顧客はカスタム属性を更新した後で同じ問題が発生します
  9. inventory_reservation テーブルを確認します。

実際の結果 :

select * from inventory_reservation;
+----------------+----------+----------+----------+-------------------------------------------------------------------------------------------------------------+
| reservation_id | stock_id | sku      | quantity | metadata                                                                                                    |
+----------------+----------+----------+----------+-------------------------------------------------------------------------------------------------------------+
|              1 |        1 | simple_1 |  -1.0000 | {"event_type":"order_placed","object_type":"order","object_id":"","object_increment_id":"000000001"}        |
|              2 |        1 | simple_1 |   1.0000 | {"event_type":"creditmemo_created","object_type":"order","object_id":"1","object_increment_id":"000000001"} |
|              3 |        1 | simple_1 |   1.0000 | {"event_type":"creditmemo_created","object_type":"order","object_id":"1","object_increment_id":"000000001"} |
+----------------+----------+----------+----------+-------------------------------------------------------------------------------------------------------------+
3 rows in set (0.00 sec)

期待される結果 :

同じクレジット メモの 2 番目の予約は作成されません。

パッチの適用

個々のパッチを適用するには、デプロイメントタイプに応じて次のリンクを使用します。

関連資料

品質向上パッチツールの詳細については、次を参照してください。

QPT で使用可能なその他のパッチについては、QPT で使用可能なパッチの節を参照してください。

recommendation-more-help
8bd06ef0-b3d5-4137-b74e-d7b00485808a