2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-04-29 20:16:44 +00:00

207 Commits

Author SHA1 Message Date
Oliver
0bb0047fcd Add unit tests for the auto_allocate_stock method 2022-03-04 16:27:50 +11:00
Oliver
71cd6c93d1 Assign sorting priority when allocating parts to a build order
1. Direct match parts
2. Variant parts
3. Any other parts (e.g. substitute parts)
2022-03-04 16:02:50 +11:00
Oliver
434f563a41 Adds API endpoint for "auto allocating" stock items against a build order.
- If stock exists in multiple locations, and the user "does not care" where to take from, simply iterate through and take
2022-03-04 15:26:00 +11:00
Oliver
28a7ad7f0e Bug fix for BuildOrder.bom_items
- Now uses the query generator provided by the Part model
- No more code duplication
- More importantly, no more code duplication which is WRONG!
2022-03-01 23:53:33 +11:00
Oliver
fea6091e42 Fix incorrect inputs 2022-02-25 15:57:30 +11:00
Oliver
9e3406efc9 Add stock tracking code to indicate stock has been consumed by a build order 2022-02-25 15:56:09 +11:00
Oliver
bb164ed72a Remove old unused functions 2022-02-25 15:47:07 +11:00
Oliver
3dde0dbb2b PEP fixes 2022-02-25 15:43:45 +11:00
Oliver
44008f33e2 Refactoring Build model functions
- Determining if a build order is correctly allocated has become more complex
- Complex BOM behaviours (e.g. variants, templates, and substitutes) have made it more difficult!
- Recently, a reference to the defining BomItem object was added to the BuildItem model
- Now, a simpler way is to check allocation against the parent BomItem
- It is much better, but means that a lot of refactoring and testing will be required!
2022-02-25 15:40:49 +11:00
Oliver
2b344f1f25 PEP style fixes 2022-02-15 13:30:14 +11:00
Oliver
07af0902a3 Optionally auto-allocate stock items when creating a new build output 2022-02-15 13:27:14 +11:00
Oliver
96af074365 Adds API endpoint to delete build outputs 2022-02-10 00:46:38 +11:00
Oliver Walters
00d7cf88e8 Throw validation error if no build outputs have been started 2022-02-01 15:58:18 +11:00
Oliver
fde2b03172 Merge remote-tracking branch 'inventree/master' into triggers
# Conflicts:
#	InvenTree/plugin/mixins/__init__.py
2022-01-10 20:34:42 +11:00
Oliver
1243923944 Event refactoring 2022-01-10 17:28:44 +11:00
Oliver
886b1f1d72 Simplify event triggering
- add generic receivers for database actions
- exclude django_q tables, otherwise we get an infinite loop!

Ref: https://stackoverflow.com/questions/17507784/consolidating-multiple-post-save-signals-with-one-receiver/32230933#32230933
2022-01-10 17:24:53 +11:00
Oliver
13d8bf437a PEP fixes 2022-01-10 09:02:11 +11:00
Oliver
5acd880f39 Fix for triggered events 2022-01-10 08:54:11 +11:00
Oliver
d765be8c73 Iterate through plugins in a separate background task 2022-01-09 22:58:59 +11:00
Oliver
da9fa1313c Increased unit testing 2022-01-09 22:14:48 +11:00
Oliver Walters
12b3a5c9cc Validate and save the new serailizer 2022-01-07 11:33:27 +11:00
Oliver
d573668f81 Correctly allow "inherited" BOM items to be allocated to a build order
- Some back-end logic was not running correctly
2021-12-11 01:05:19 +11:00
Matthias
d884e62be1
[FR] Confirm to W293
Fixes #2335
2021-11-23 00:28:23 +01:00
Oliver
b2ae346343 Provide model-level default function option 2021-11-08 13:30:59 +11:00
Oliver
01191d84c5 Only run check stock function when updating an existing part 2021-11-04 14:32:42 +11:00
Oliver
99b324d1ef Add a post-save hook the "Build" model to check stock 2021-11-04 14:30:23 +11:00
Oliver
ccaa7d2683 Merge branch 'master' into build-output-complete 2021-10-16 13:18:35 +11:00
Oliver
54dd05a24d Add an API serializer to complete build outputs 2021-10-14 23:13:01 +11:00
Oliver
7ce0f817aa Add a 'reference_int' field to the models, to be used as a secondary index 2021-10-14 17:45:43 +11:00
Oliver
4a6bd0123a Bug fixes 2021-10-14 11:00:27 +11:00
Oliver
7dfffcd5d3 Move "build unallocate" functionality to the API
- Much much simpler now!
- Filtering is against bom_item, not part
- Fixes a bug with the new (reasonably complex) substitution framework
2021-10-14 10:32:43 +11:00
Oliver
be5c5496b2 Improvements to allocation of stock items against build orders
- Refactor functions for filtering stock using bom_item pk
- Allow selection of substitute items when allocating against build order
- Improvements for modal rendering
- Don't display filter drop-down if there are no filters available
2021-10-13 23:53:35 +11:00
Oliver
ae0efe73d1 Further improvements to build allocation form
- Auto-allocation button ignores outputs which are complete
- StockItem API allows filtering by BomItem
- Quantity inputs are now auto-filled
- Display progress bar in the modal form
2021-10-05 08:25:10 +11:00
Oliver
dd4db6442e PEP fixes 2021-10-05 00:45:49 +11:00
Oliver
8a90b9df6d Improve clean() function for BuildItem model
- BuildItemDelete now handled by API forms
- BuildItemEdit now handled by API forms
2021-10-05 00:14:31 +11:00
Oliver
5ded23fd99 Fixes for serializer validation
- Note: use the validate() function!
- Ref: https://www.django-rest-framework.org/api-guide/serializers/
- override serializer.save() functionality for simpler operation
2021-10-04 23:44:23 +11:00
Oliver
4ee0004c97 Filtering for Build and StockItem 2021-07-21 21:34:16 +10:00
Oliver
ecf47aa69d Fix for BuildOrder reference default value 2021-07-09 01:20:29 +10:00
Oliver
bec98d355a Improvements
- part_detail defaults to True for BuildSerializer
- Handle invalid parent for BuildOrder
2021-07-09 00:49:19 +10:00
Oliver
5016d44b83 Add default value for BuildOrder reference 2021-07-09 00:15:49 +10:00
Oliver
04374c71c2 Annotate models with their API list view
- It will make sense, trust me
2021-06-25 00:17:58 +10:00
Oliver
0c14457598 Fix typo in getStockItemThumbnail 2021-06-09 11:16:37 +10:00
Oliver
9fd212d1b2 BuildItemSerializer: Handle errors when thumbnail is not found 2021-06-09 09:41:27 +10:00
Oliver Walters
ee9df039cb allocatedItems function now takes variants into account 2021-06-01 16:19:24 +10:00
Oliver Walters
9baf856d75 Fixes for build item allocation rendering 2021-06-01 16:14:26 +10:00
Oliver Walters
7578cab9a8 Add 'bom_item' field to BuildItem model
- Required to link the build to the output in case of variant stock
2021-06-01 15:25:39 +10:00
Oliver Walters
af53b341f0 Replace "addTrasactionNote" function with "add_tracking_entry"
- Does not add translated strings to the database
2021-05-11 17:17:48 +10:00
f2b0717d10 removes all lines consisting only of spaces
this really bothers me for some reason - nothing technical
2021-05-06 12:11:38 +02:00
eeintech
f0b44450fb Updated 'Required for Build Orders' API queryset 2021-04-27 12:48:36 -04:00
Oliver Walters
9b763ca715 Adds ability to specify "status" of a build output at time of completion 2021-04-21 16:44:18 +10:00