Skip to content

Build order consume #8191

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

Merged
merged 84 commits into from
Aug 19, 2025

Conversation

SchrodingersGat
Copy link
Member

@SchrodingersGat SchrodingersGat commented Sep 26, 2024

This is a large(ish) feature branch which allows stock to be consumed by a build order before the build order is complete.

This allows more complex (and useful) workflows, where the build might take some significant time, but the stock is consumed at the start. e.g. a batch of PCBs are loaded, but then require a lot of testing, etc.

Currently, the allocated stock must "languish" in the build order, and this makes tracking of real stock quantities difficult.

Given that this feature might take a while to integrate and test, I am targetting it (for now at least) against 1.0.0. This will not be implemented in the legacy user interface.

Tasks

  • Update documenation around new workflows
  • User interface updates
  • Playwright testing
  • Updated unit testing
  • Ensure partial allocation vs partial consumption works well
  • Add dummy data to the demo dataset - Add partially consumed stock demo-dataset#95
  • Ensure that the "REQUIRED" counts still make sense (take "consumed" into account)
  • Check that the "required" counts are correct in the API (unit testing)
  • Ensure table filters work correctly for the build-line table

@SchrodingersGat SchrodingersGat added this to the 1.0.0 milestone Sep 26, 2024
@SchrodingersGat SchrodingersGat marked this pull request as draft September 26, 2024 10:37
Copy link

netlify bot commented Sep 26, 2024

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

Name Link
🔨 Latest commit e0da640
🔍 Latest deploy log https://app.netlify.com/projects/inventree-web-pui-preview/deploys/68a404487de65d0008d1a123
😎 Deploy Preview https://deploy-preview-8191--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: 97 (no change from production)
Accessibility: 81 (no change from production)
Best Practices: 100 (no change from production)
SEO: 78 (no change from production)
PWA: -
View the detailed breakdown and full score reports

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

Copy link

codecov bot commented Sep 26, 2024

Codecov Report

❌ Patch coverage is 91.32653% with 17 lines in your changes missing coverage. Please review.
✅ Project coverage is 87.12%. Comparing base (698249e) to head (e0da640).
⚠️ Report is 5 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #8191      +/-   ##
==========================================
- Coverage   87.14%   87.12%   -0.03%     
==========================================
  Files        1258     1259       +1     
  Lines       55966    56269     +303     
  Branches     2078     2072       -6     
==========================================
+ Hits        48773    49024     +251     
- Misses       6682     6735      +53     
+ Partials      511      510       -1     
Flag Coverage Δ
backend 88.84% <91.32%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
Backend Apps 91.36% <91.28%> (-0.08%) ⬇️
Backend General 93.55% <ø> (-0.09%) ⬇️
Frontend 70.07% <ø> (+0.01%) ⬆️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Contributor

@matmair matmair left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice addition!

@SchrodingersGat SchrodingersGat marked this pull request as ready for review August 17, 2025 05:34
@SchrodingersGat SchrodingersGat changed the title [WIP] Build order consume Build order consume Aug 17, 2025
@SchrodingersGat SchrodingersGat added enhancement This is an suggested enhancement or new feature User Interface Related to the frontend / User Interface api Relates to the API labels Aug 17, 2025
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This pull request implements the ability to consume stock items against build orders before the build order is completed, allowing for more flexible workflows where stock is consumed at the start while the build may take significant time to finish.

Key changes:

  • Adds stock consumption functionality for build orders with new API endpoints and UI components
  • Updates part requirements calculation to account for consumed stock quantities
  • Enhances build line allocation and consumption tracking with visual progress indicators

Reviewed Changes

Copilot reviewed 19 out of 20 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
Frontend tests Updates test timeouts and adds consumption workflow tests
BuildLineTable.tsx Adds consumption functionality, filters, and progress indicators
BuildAllocatedStockTable.tsx Integrates stock consumption actions and forms
BuildForms.tsx Implements new consumption forms for build items and lines
API/Backend models Adds consumed field to BuildLine model and consumption endpoints
Documentation Updates allocation documentation with consumption workflows

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@SchrodingersGat SchrodingersGat merged commit 49cc5fb into inventree:master Aug 19, 2025
32 checks passed
@SchrodingersGat SchrodingersGat deleted the build-order-consume branch August 19, 2025 07:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api Relates to the API build Build orders enhancement This is an suggested enhancement or new feature feature User Interface Related to the frontend / User Interface
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants