Skip to content

State transition support for generic states - #6017

Merged
SchrodingersGat merged 21 commits into
inventree:masterfrom
matmair:added-state-transitions
Dec 7, 2023
Merged

SchrodingersGat merged 21 commits into
inventree:masterfrom
matmair:added-state-transitions

Conversation

@matmair

@matmair matmair commented Dec 1, 2023 •

Copy link
Copy Markdown
Member

This WIP PR adds the option to define methods that should be called when objects transition between states.

Missing:

  • QoL improvements around developing classes
  • sample plugin & unit tests

@matmair matmair added order Related to purchase orders / sales orders plugin Plugin ecosystem labels Dec 1, 2023
@matmair matmair self-assigned this Dec 1, 2023
@netlify

netlify Bot commented Dec 1, 2023 •

Copy link
Copy Markdown

✅ Deploy Preview for inventree-web-pui-preview ready!

Name Link
🔨 Latest commit f9804ff
🔍 Latest deploy log https://app.netlify.com/sites/inventree-web-pui-preview/deploys/656f9b95619c410008b8f91e
😎 Deploy Preview https://deploy-preview-6017--inventree-web-pui-preview.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 100 (no change from production)
Accessibility: 86 (no change from production)
Best Practices: 92 (no change from production)
SEO: 70 (no change from production)
PWA: -
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify site configuration.

@SchrodingersGat

Copy link
Copy Markdown
Member

Can you provide some end-goal examples of how this transition management would be used?

@matmair

matmair commented Dec 1, 2023

Copy link
Copy Markdown
Member Author

@SchrodingersGat I will provide a sample implementation

@matmair

matmair commented Dec 5, 2023

Copy link
Copy Markdown
Member Author

@SchrodingersGat this would be ready for review; is the sample code added enough to understand the use case?
Without custom states #4969 this is not usable for full-state machines but still helpful to enhance the control flow via plugins.

@matmair
matmair marked this pull request as ready for review December 6, 2023 19:16
@SchrodingersGat

Copy link
Copy Markdown
Member

@matmair this looks good to me. I would like to see this added to the BuildOrder and StockItem classes, but that can happen as a separate PR if you like. Happy to merge this now. thanks for the work!

@SchrodingersGat
SchrodingersGat merged commit 974ea1e into inventree:master Dec 7, 2023
@matmair
matmair deleted the added-state-transitions branch December 7, 2023 07:39
@matmair matmair added this to the 0.13.0 milestone Dec 7, 2023
@matmair matmair added the enhancement This is an suggested enhancement or new feature label Dec 7, 2023
@matmair

matmair commented Dec 7, 2023

Copy link
Copy Markdown
Member Author

@SchrodingersGat I will look into that. The way those models work is a bit different from orders so I will have to check what impacts the change would have.

matmair added a commit to matmair/InvenTree that referenced this pull request Dec 27, 2023
SchrodingersGat pushed a commit that referenced this pull request Dec 27, 2023
github-actions Bot pushed a commit that referenced this pull request Dec 27, 2023
Fixes #6136

Error introduced in #6017

(cherry picked from commit 88f86ef)
SchrodingersGat pushed a commit that referenced this pull request Dec 27, 2023
Fixes #6136

Error introduced in #6017

(cherry picked from commit 88f86ef)

Co-authored-by: Matthias Mair <code@mjmair.com>
@matmair matmair mentioned this pull request Feb 12, 2024
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement This is an suggested enhancement or new feature order Related to purchase orders / sales orders plugin Plugin ecosystem

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants