MDVA-36572:更新贷项通知单后创建的新库存预留

受影响的产品和版本

该修补程序是为Adobe Commerce版本创建的:
云基础架构上的Adobe Commerce 2.4.1

与Adobe Commerce版本兼容:

Adobe Commerce(所有部署类型) 2.3.5-2.4.2-p1

NOTE
该修补程序可能适用于具有新的Quality Patches Tool版本的其他版本。 要检查该修补程序是否与您的Adobe Commerce版本兼容,请更新 magento/quality-patches 包到最新版本,并检查 Quality Patches Tool:搜索修补程序页面. 使用修补程序ID作为搜索关键字来查找修补程序。

问题

每次更新贷项通知单时,都会触发贷项通知单保留更新观察程序。 根据与PO的协议,保留更新的逻辑更改为仅在创建贷项通知单时触发。 PO将在单独票证的范围中审查通过API编辑贷项通知单的可能性。

重现问题的步骤

  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)

预期结果

不会为同一贷项通知单创建第二个预留。

应用修补程序

要应用单独的修补程序,请根据您的部署类型使用以下链接:

相关阅读

要了解有关Quality Patches Tool的更多信息,请参阅:

有关QPT中可用的其他修补程序的信息,请参阅 QPT中可用的修补程序 部分。

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