Commit Graph

282 Commits

Author SHA1 Message Date
Oliver 00b75d792e
Adds API mixin for "bulk delete" (#3146)
* Introduces a BulkDelete API mixin class

- Allows deletion of multiple items against a single API request

* Bump API version

* Adds BulkDelete mixin to StockItemTestResult API class

* refactor "multi BOM Item delete" to use new approach

* Refactor various attachment API endpoints

* Refactor multi delete for StockItem

* Convert remaining enndpoints over

* Fix for API test code
2022-06-07 07:25:12 +10:00
Oliver a066fcc909
Add new global setting to control auto-upload of test reports (#3137)
* Add new global setting to control auto-upload of test reports

* Adds callback to attach a copy of the test report when printing

* Fix for all attachment API endpoints

- The AttachmentMixin must come first!
- User was not being set, as the custom 'perform_create' function was never called

* Remove duplicated UserSerializer

* display uploading user in attachment table

* Add unit test to check the test report is automatically uploaded
2022-06-06 15:20:41 +10:00
Matthias Mair f38386b13c
Add more checks to pre-commit (#3132)
* Add bandit to pre-commit checks

* fix catchall exceptions

* remove unused definitons

* remove unuseed ariables

* Add docstring

* fix B006, B008 errors

* fix B007 error

* ignore B009

* Add checks for formatting and naming
2022-06-06 08:56:52 +10:00
Oliver bbbfd003e0
Convert category parameter forms to use the API (#3130)
* Moving PartCategoryParameterTemplate model to the API

- Add detail API endpoint
- Add 'create' action to LIST endpoint

* Update settings page to use the new API forms

* Remove old views / forms

* Update API version

* Fix table buttons

* Add title to deletion form

* Add unit tests for new API views
2022-06-06 00:25:08 +10:00
Oliver 2e40f3ccf3
Move PartParameterTemplate model to the API (#3123)
* Adds detail API view for the PartParameterTemplate model

* Use API methods rather than server-side forms

* Remove old views / forms

* Update API version
2022-06-03 17:11:19 +10:00
Matthias Mair 0c97a50e47
Docstring checks in QC checks (#3089)
* Add pre-commit to the stack

* exclude static

* Add locales to excludes

* fix style errors

* rename pipeline steps

* also wait on precommit

* make template matching simpler

* Use the same code for python setup everywhere

* use step and cache for python setup

* move regular settings up into general envs

* just use full update

* Use invoke instead of static references

* make setup actions more similar

* use python3

* refactor names to be similar

* fix runner version

* fix references

* remove incidential change

* use matrix for os

* Github can't do this right now

* ignore docstyle errors

* Add seperate docstring test

* update flake call

* do not fail on docstring

* refactor setup into workflow

* update reference

* switch to action

* resturcture

* add bash statements

* remove os from cache

* update input checks

* make code cleaner

* fix boolean

* no relative paths

* install wheel by python

* switch to install

* revert back to simple wheel

* refactor import export tests

* move setup keys back to not disturbe tests

* remove docstyle till that is fixed

* update references

* continue on error

* add docstring test

* use relativ action references

* Change step / job docstrings

* update to merge

* reformat comments 1

* fix docstrings 2

* fix docstrings 3

* fix docstrings 4

* fix docstrings 5

* fix docstrings 6

* fix docstrings 7

* fix docstrings 8

* fix docstirns 9

* fix docstrings 10

* docstring adjustments

* update the remaining docstrings

* small docstring changes

* fix function name

* update support files for docstrings

* Add missing args to docstrings

* Remove outdated function

* Add docstrings for the 'build' app

* Make API code cleaner

* add more docstrings for plugin app

* Remove dead code for plugin settings
No idea what that was even intended for

* ignore __init__ files for docstrings

* More docstrings

* Update docstrings for the 'part' directory

* Fixes for related_part functionality

* Fix removed stuff from merge 99676ee

* make more consistent

* Show statistics for docstrings

* add more docstrings

* move specific register statements to make them clearer to understant

* More docstrings for common

* and more docstrings

* and more

* simpler call

* docstrings for notifications

* docstrings for common/tests

* Add docs for common/models

* Revert "move specific register statements to make them clearer to understant"

This reverts commit ca96654622.

* use typing here

* Revert "Make API code cleaner"

This reverts commit 24fb68bd3e.

* docstring updates for the 'users' app

* Add generic Meta info to simple Meta classes

* remove unneeded unique_together statements

* More simple metas

* Remove unnecessary format specifier

* Remove extra json format specifiers

* Add docstrings for the 'plugin' app

* Docstrings for the 'label' app

* Add missing docstrings for the 'report' app

* Fix build test regression

* Fix top-level files

* docstrings for InvenTree/InvenTree

* reduce unneeded code

* add docstrings

* and more docstrings

* more docstrings

* more docstrings for stock

* more docstrings

* docstrings for order/views

* Docstrings for various files in the 'order' app

* Docstrings for order/test_api.py

* Docstrings for order/serializers.py

* Docstrings for order/admin.py

* More docstrings for the order app

* Add docstrings for the 'company' app

* Add unit tests for rebuilding the reference fields

* Prune out some more dead code

* remove more dead code

Co-authored-by: Oliver Walters <oliver.henry.walters@gmail.com>
2022-06-02 01:37:39 +10:00
Oliver 02607bd854
Search improvements (#3103)
* Allow part list API to be searched by SKU

* Enable manufacturer parts and supplier parts search preview

* Increment API version

* Remove whitespace

* Remove more whitespace
2022-05-31 11:51:22 +10:00
Matthias Mair e1d22f538d resort imports 2022-05-20 17:24:51 +02:00
Oliver c51f052f25
Merge pull request #3011 from matmair/matmair/issue2996
Remove python 2 code
2022-05-17 00:51:31 +10:00
Oliver Walters 37a74dbfef Adds a metadata serializer class for accessing instance metadata via the API
- Adds endpoint for Part
- Adds endpoint for PartCategory
- Adds endpoint for StockItem
- Adds endpoint for StockLocation
2022-05-16 20:59:09 +10:00
Matthias ecccfbd546
Remove encoding header
Fixes #2996
2022-05-15 20:33:00 +02:00
Oliver c89547f58c Adds exporter and download functionality for BuildOrder table 2022-05-12 12:44:15 +10:00
Oliver 465e69c254 Refactor exporters for:
- Part
- PurchaseOrderLineItem
2022-05-12 11:33:17 +10:00
Matthias de6507e918
update translation commands 2022-05-01 22:03:49 +02:00
Matthias 67ab45bdee
update depreciated paths 2022-05-01 22:00:18 +02:00
Oliver 6538ab86cb Bug fix for 'required' filter in PartTestTemplate API 2022-04-28 16:25:04 +10:00
Oliver Walters 7db11b627b Refactor PartSalePriceBreak and PartInternalPriceBreak tables to use the API
- Remove old server-side views
- Simplify code
2022-04-26 19:53:09 +10:00
Oliver 693e47ab89 Remove outdated filter_fields variable 2022-04-26 11:02:22 +10:00
Oliver e1e0432963 Adds 'variant_of' filter back into Part API 2022-04-26 10:57:43 +10:00
Oliver Walters 30a4c38eb7 Ensure queryset is properly annotated for BomItem detail 2022-04-05 21:12:43 +10:00
Oliver Walters e0acfe492b Merge remote-tracking branch 'inventree/master' into bom-serializer-quantity 2022-04-05 19:49:06 +10:00
Oliver Walters 0908aa8c8c Allow sorting of part table by unallocated_stock 2022-04-05 00:31:44 +10:00
Oliver Walters f6664b2477 Add annotated fields to BomItem API:
- total-stock / allocated_to_build_orders / allocated_to_sales_orders
2022-04-04 22:50:13 +10:00
Kálmán Rózsahegyi a9f7457c12 New part table filter on available stock 2022-04-03 12:30:53 +02:00
Oliver Walters c103f0c100 Do not generate parameter data on the server side when rendering part category templates 2022-03-19 22:14:18 +11:00
Oliver Walters 81d5ff8f79 Adds ability to list part parameters via the Part API 2022-03-19 21:56:57 +11:00
Oliver Walters 62d01cdbab Adds filtering options to PartParameterTemplate endpoint
- Allows filtering by part
- Allows filtering by category
2022-03-19 21:31:28 +11:00
Oliver f7d724aa0c Merge remote-tracking branch 'inventree/master' into scheduling
# Conflicts:
#	InvenTree/InvenTree/version.py

(Update API version)
2022-03-08 12:25:36 +11:00
Oliver 4f74a27e1a Exporting data from a Part table now uses the API too
- Makes use of the existing table filters
- Exported data matches exactly what you see in the table!
2022-03-03 17:42:31 +11:00
Oliver 9a62fe6993 style fixes 2022-03-01 23:31:18 +11:00
Oliver f33f1a339d Add more information to scheduling chart
Also improves chart styling
2022-03-01 23:20:08 +11:00
Oliver 776dffe779 Scheduling information is now calculated on the server, and provided via a new API endpoint
- Much simpler than sequencing multiple API calls
2022-03-01 22:54:49 +11:00
Oliver 580effab92 Merge remote-tracking branch 'inventree/master' into match-fields
# Conflicts:
#	InvenTree/InvenTree/version.py
2022-02-17 22:55:16 +11:00
Oliver f485bc7d53 PEP fixes 2022-02-17 17:04:51 +11:00
Oliver 0604e1a127 Adds API endpoint for installing stock items into other stock items
- Requires more filtering for the Part API
- Adds more BOM related functionality for Part model
- Removes old server-side form
2022-02-17 17:03:17 +11:00
Oliver f399f4fa34 Refactoring API endpoints
- Improved URL naming scheme
2022-02-16 16:57:27 +11:00
Oliver d7adb6959d Adds functionality to map file columns to model fiels 2022-02-16 14:57:13 +11:00
Oliver a2c48d308f Adds a BomUpload endpoint to handle upload of complete BOM 2022-02-07 10:54:37 +11:00
Oliver 137c9ff2f2 POST request now returns extracted data rows (as an array of dicts) 2022-02-05 00:30:00 +11:00
Oliver 611592694b Adds serializer for uploading a BOM file and extracting fields 2022-02-05 00:12:11 +11:00
Matthias c44565f9e3
fix reused builtins 2022-01-21 00:17:52 +01:00
Oliver 2c0da25cbc "Validate BOM" now uses the API also 2021-12-21 22:45:59 +11:00
Oliver 0c8a047bc2 Adds simply endpoint for BOM duplication 2021-12-21 17:29:14 +11:00
Oliver e9ae3eb01d Revert to bootstrap-treeview
- More "bootstrappy" design
- Already in code base
- Cleaner API
2021-12-11 00:25:44 +11:00
Matthias 596532f312
only one api call 2021-12-08 00:05:34 +01:00
Matthias 948270bbcb
add stuff to mark starting endpoint 2021-12-07 23:54:45 +01:00
Matthias c703f9993f
make url simpler 2021-12-06 22:37:42 +01:00
Matthias 70939a0cf9
first working example 2021-12-06 22:35:14 +01:00
Oliver 9e1251d78d Adds "assigned_to_me" filtering to build orders 2021-12-04 21:30:11 +11:00
Matthias 3bff676047
beginner mistake
it is a referenced part so use related_name as prefix
2021-12-02 00:24:36 +01:00