Skip to content

We can't detect the date time when Order is chagend to status as 'complete' #9730

@cristianmalfesi

Description

@cristianmalfesi

When process an Order on Magento 2 we have different status like Pending, Invoiced, Shipment, Complete, etc. Working in production mode we found that is too difficult detect the datetime when an Order change to 'complete' status.
There is a table called 'sales_order_status_history' that save the history of every step on one order. But we tested change in different way the order, and allways show the field status = 'processing', inclusively when order is changed to status = 'complete'. In this way can not detect the real dateime when order go changing to different status.

Preconditions

On production mode on Magento 2 using Luma theme, simulate a purchase on frontend with normal user, this create an Order in pending mode (the payment method is not important, we have tested with different methods).

Environment: Tested using Magento 2.1.3 and 2.1.6 (PHP 7, Mysql 5.6, Nginx)

Steps to reproduce

  1. Go to frontend, make a purchase, using any payment method, and finish the purchase process on checkout.
  2. Got to admin panel, search the order generated, make a shipment and update order status.
  3. Again open the order and generate Invoice and update order status.
    4.Finally check that order show the order status = 'complete'

Expected result

  1. If we make a SQL on database checking datetime of every change of status of one order, the result show allways in processing mode. You can try look the process on one order with this SQL command:
    SELECT h.status, h.created_at, h.entity_name
    FROM sales_order AS o
    INNER JOIN sales_order_status_history AS h ON h.parent_id = o.entity_id
    WHERE o.increment_id = '3000004389';

We spected a result like:
status | created_at | entity_name
processing 2017-05-08 19:05:08 order
Complete 2017-05-19 19:48:38 invoice

Actual result

  1. The SQL proposed show nothing, because table sales_order_status_history allways have status in processing value.
    Current result:
    status | created_at | entity_name
    processing 2017-05-08 19:05:08 order
    processing 2017-05-19 19:48:38 invoice

Metadata

Metadata

Assignees

No one assigned

    Labels

    Component: SalesIssue: Cannot ReproduceCannot reproduce the issue on the latest `2.4-develop` branchIssue: Clear DescriptionGate 2 Passed. Manual verification of the issue description passedIssue: Format is validGate 1 Passed. Automatic verification of issue format passedIssue: Ready for WorkGate 4. Acknowledged. Issue is added to backlog and ready for developmentbug report

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions