-
-
Notifications
You must be signed in to change notification settings - Fork 889
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[FR] Update date in "updated" field on stock allocation #5630
Comments
@StormTrooper the current behaviour makes sense - stock is allocated to the system but not actually "changed" (no stock is really drawn down). I suppose that we could "touch" the last_updated date on the stock item whenever the allocations change? |
I am not sure if a change in the current behaviour is warranted, it feels logical. There is no real change till stock is moved IMO. Before that, it is just earmarked. @StormTrooper I would suggest using an event plugin if you want to sync stock - see my implementation for shopify here. Maybe I can expand my plugin also to WooCommerce, there seems to be interest in that. |
@matmair Thanks for the link, will take a look. I've also got my script syncing to eBay so it's a not going to be a quick fix. (Actually script syncs both ways between WooCommerce/Ebay/Inventree) Still not sure if I understand the current behaviour on stock levels. If for example I have 10 resistors in stock and then start a build order which uses 5 resistors as soon as I assign stock, my stock levels have changed to 5. (I still have 10 resistors but only 5 are 'in stock' and usable for other builds/can be sold) The updated field will only update when the build order is closed. Shouldn't it update as soon as the the stock is touched? If I don't sync the new stock values to WooCommerce/eBay then I could protentially sell 10 resistors where I only have 5. Is there any other trick I could use apart from an event? Worst case I can ignore the date and sync everything but that's overkill and a waste of resources. |
I have been looking for a way to sync Inventree stock to WooCommerce and came across your comment. Not sure if other people would find this useful, but I'm adding a +1 for WooCommerce support if you feel like you want to implement! |
@snorkrat I am looking into tackeling this at some point in the future by generalising the shopify plugin and adding more marketplaces. You can subscribe to this issue to get notifications if/when I find time to tackle this. |
This issue seems stale. Please react to show this is still important. |
Please verify that this feature request has NOT been suggested before.
Problem statement
Not sure if this is a FR or a bug - feels like a FR.
I have a script that syncs stock between Inventree and WooCommerce using an API.
So I call for example the below API to get the "quantity" and "updated" fields and if updated within the last day then I know the quantity has changed so I sync to WooCommerce. I need to use the "updated" field as only want to sync part stock values that have changed in the last day (Otherwise I will be syncing thousands of parts)
https://demo.inventree.org/api/stock/?format=json&part=69
"updated":"2023-09-28 10:28"
This has been working well but I've found a issue when I have a build order and allocate stock (I use the auto allocate) the stock quantity updates correctly but the "updated" date doesn't change.
The date is only changed when the build is completed.
I need to update the stock quantity before the build is complete as the build could take sometimes days to complete.
Suggested solution
Update the "updated" field as soon as the stock is allocated, or introduce a new stock_updated field.
Describe alternatives you've considered
The work around for this is to view the part and redo the count part stock - after this the date on the "updated" field is updated.
Examples of other systems
No response
Do you want to develop this?
The text was updated successfully, but these errors were encountered: