InvenTree icon indicating copy to clipboard operation
InvenTree copied to clipboard

[FR] Dynamic Status Flags for Build/Sales Orders

Open simonkuehling opened this issue 2 years ago • 16 comments

Please verify that this feature request has NOT been suggested before.

  • [X] I checked and didn't find a similar feature request

Problem statement

For better work planning of more complex assemblies (multiple levels of child build orders) I am thinking about a way to indicate if a BuildOrder or SalesOrder is ready for attention - which would be true if

  • enough stock is available to fully allocate all BOM Items/ SalesOrder Items
  • the BuildOrder/SalesOrder is fully allocated

Suggested solution

It would be really good to have actionable status codes like "Ready for Production" (BuildOrder) and "Ready for Commissioning" (SalesOrder).

Currently status codes are mostly static and get changed by the business logic - it is probably a heap of work to change that into a dynamic value, especially since i assume the check for "can be allocated from available stock" is not a cheap db request, right?

Describe alternatives you've considered

Alternatively the status flags could be handled just like they are right now - just adding those two new flags to the logic. I do not see a neat way of triggering those new flags without periodic background tasks or the like, though. Any ideas on that?

Examples of other systems

No response

Do you want to develop this?

  • [ ] I want to develop this.

simonkuehling avatar Dec 19 '23 09:12 simonkuehling

@simonkuehling I see the appeal here, and also think that perhaps status information such as "ready for build" or "ready for shipping" may be somewhat "user specific".

You are also right that making these values "dynamic" would be tricky, and "expensive" (in terms of database hits).

Perhaps this would be a good candidate for a custom plugin which could run some code in the background worker to update some extra status metadata for the order?

SchrodingersGat avatar Jan 10 '24 12:01 SchrodingersGat

I did consider building a plugin for this - which would be totally fine as a solution for me. As far as I understood so far there is no easy way to directly inject html into the build order tables or build order views via plugin... could be that I am missing something here, though.

As a starting point, using a plugin with the MetadataMixin and background processing could be a feasible approach in general, good point. If I skip the requirement of visual indication in the views I would still need at least some kind of native "filter by metadata" functionality, though. That could generally be implemented since the metadata is a Django JSONField which can be filtered directly in the DB like any other field, right?

Provided that this is indeed possible - would you consider this a useful native feature for Inventree?

simonkuehling avatar Jan 10 '24 15:01 simonkuehling

This issue seems stale. Please react to show this is still important.

github-actions[bot] avatar Mar 11 '24 11:03 github-actions[bot]

(not stale - waiting for feedback)

simonkuehling avatar Mar 11 '24 11:03 simonkuehling

This issue seems stale. Please react to show this is still important.

github-actions[bot] avatar May 11 '24 11:05 github-actions[bot]

(not stale)

simonkuehling avatar May 11 '24 12:05 simonkuehling

This issue seems stale. Please react to show this is still important.

github-actions[bot] avatar Jul 11 '24 11:07 github-actions[bot]

@simonkuehling I assume that a plugin would be able to do most stuff needed. With the new frontend being API driven, I can see ways to add support for plugins injecting custom columns. If this is something you would be interested in, we can maybe discuss the technicalities.

cc @wolflu05 regarding frontend feasibility

matmair avatar Aug 09 '24 18:08 matmair

This is a nice idea, maybe we can also add the ability to let plugins inject custom table actions, buttons above the table, scan actions, ...

But I think first we need to get basic pui panel plugins integrated.

wolflu05 avatar Aug 09 '24 19:08 wolflu05

@matmair due to time constraints I cannot jump into the development of the new frontend just yet, but I am eagerly tracking your progress and am excited for the first "plublic/general" release of that - I'm a big fan of true API<->UI separation. At that point I can test new plugins/features live in production, which is very helpful for these kinds of process/flow/usability type of improvements.

I think it would be good to just leave this issue open for now and tackle it when v1 is ready?

simonkuehling avatar Aug 19 '24 07:08 simonkuehling

PUI was included in the last 2 releases. We have stopped developing the old UI - I consider it released. With 1.0 we will probably remove CUI completely.

matmair avatar Aug 19 '24 10:08 matmair

oh, ok - haven't even looked at the releases for a while to notice, I was following the PUI epic so far... guess I'm on upgrade duty today!

simonkuehling avatar Aug 19 '24 12:08 simonkuehling

@matmair can this be closed out now?

SchrodingersGat avatar Aug 24 '24 00:08 SchrodingersGat

@simonkuehling have you had a chance to review the new changes?

SchrodingersGat avatar Aug 24 '24 00:08 SchrodingersGat

i have upgraded our system and getting myself familiar with the new frontend code, yes. As far as I can tell there is not yet a plugin system for the frontend right now, correct?

simonkuehling avatar Aug 24 '24 14:08 simonkuehling

Yes, PUI has no plugins yet, see #7470

wolflu05 avatar Aug 24 '24 14:08 wolflu05

This issue seems stale. Please react to show this is still important.

github-actions[bot] avatar Oct 24 '24 11:10 github-actions[bot]