inventory icon indicating copy to clipboard operation
inventory copied to clipboard

Add updated_at field + database trigger into inventory source item table

Open tschirmer opened this issue 1 month ago • 2 comments

Description (*)

update_at field into the stock inventory table

select * from inventory_source_item limit 10;
+----------------+-------------+------------+----------+--------+
| source_item_id | source_code | sku        | quantity | status |
+----------------+-------------+------------+----------+--------+
|              1 | default     | POS-104002 |   4.0000 |      1 |
|              2 | default     | POS-104003 |   2.0000 |      1 |
|              3 | default     | POS-124005 |   8.0000 |      1 |
|              4 | default     | POS-SFR-6612 |   0.0000 |      1 |
|              5 | default     | POS-104004 |   2.0000 |      1 |
|              6 | default     | POS-104006 |   1.0000 |      1 |
|              7 | default     | POS-104007 |   2.0000 |      1 |
|              8 | default     | POS-104008 |   4.0000 |      1 |
|              9 | default     | POS-104009 |   4.0000 |      1 |
|             10 | default     | POS-104011 |   3.0000 |      1 |
+----------------+-------------+------------+----------+--------+

Expected behavior (*)

Expected behaviour is to add it to the database, and let the database manage the updated_at field on save

Benefits

Currently there is no way of knowing when stock was updated. We're running a sync, and the product update_at isn't changed on stock changes, and the inventory table also is not changed.

This prevents a partial sync to other systems. e.g.

select * from inventory_source_item where updated_at > last_sync_time;

Additional information

Should be available via the api in some fashion, ideally in the export_salable_qty rest api endpoint to allow bulk lookups.

tschirmer avatar Dec 08 '25 05:12 tschirmer

Hi @tschirmer. Thank you for your report. To speed up processing of this issue, make sure that you provided sufficient information. Add a comment to assign the issue: @magento I am working on this


Join Magento Community Engineering Slack and ask your questions in #github channel.

m2-assistant[bot] avatar Dec 08 '25 05:12 m2-assistant[bot]

Hello @tschirmer,

Thank you for the report and collaboration!

After going through with the description, it seems to have a feature request. Hence we are marking it as feature request.

If you have a fix for this, you can create a PR for the same. We will be happy to process the same.

Thank you

engcom-Hotel avatar Dec 09 '25 09:12 engcom-Hotel