2
0
mirror of https://github.com/inventree/InvenTree.git synced 2026-05-23 09:35:30 +00:00
Commit Graph

56 Commits

Author SHA1 Message Date
luwol03 26a85d5e95 Tests/stocklocation and partcategory (#3473)
* Added description to response field check

* Added more tests

* Update InvenTree/part/test_api.py
2022-08-05 10:58:01 +10:00
luwol03 a9e22d0ae9 Fix: Treegrid is loading an eternity for huge amounts of data (#3451)
* Added default max depth and lazy loading to StorageLocation

* Added default max depth and lazy loading to PartCategory

* Update API version

* lint: fix

* Added INVENTREE_TREE_DEPTH setting

* Refactored int conversion into own helper function

* Added tests
2022-08-05 08:07:12 +10:00
Oliver 8b464e4397 Migrate "Convert to Variant" form to the API (#3183)
* Adds a Part API filter to limit query to valid conversion options for the specified part

* Refactor 'exclude_tree' filter to use django-filter framework

* Refactor the 'ancestor' filter

* Refactoring more API filtering fields:

- variant_of
- in_bom_for

* Adds API endpoint / view / serializer for converting a StockItem to variant

* stock item conversion now perfomed via the API

* Bump API version

* Add unit tests for new filtering option on the Part list API endpoint

* Adds  unit test for "convert" API endpoint functionality
2022-06-12 16:06:11 +10:00
Oliver 403655e3d2 Adding bulk deletion endpoint for notifications (#3154)
* Catch DoesNotExist error

* Move notificationtable function to js file

* Fix for custom metadata class

- Previously only worked if a POST or PUT action was available on the endpoint
- So, a ListAPIView endpoint would not actually work!
- Adding in a BulkDelete mixin to a ListAPIView caused failure

* Add unit test to ensure new OPTIONS metadata updates are checked

* Expand functionality of the existing BulkDelete mixin

- Allow deletion by custom filters
- Allow each implementing class to implement custom filters
- Adds more unit testing for BulkDelete mixin class

* Add bulk delete operation for Notification API

- Ensure users can only delete their *own* notifications

* Improve notification tables / buttons / etc

* Adds unit testing for bulk delete of notifications

- Fixed API permissions for notifications list endpoint

* Update BulkDelete operations for the StockItemTestResult table

* Use filters parameter in attachments table to ensure that only correct attachments are deleted

* JS linting

* Fixes for unit tests
2022-06-08 07:45:30 +10:00
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 4b3f77763d Return from customer (#3120)
* Adds ability to return item into stock via the API

* Remove old server-side form / view for returning stock from a customer

* Add unit tests for new API endpoint
2022-06-03 08:36:08 +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
Matthias Mair e1d22f538d resort imports 2022-05-20 17:24:51 +02:00
Oliver Walters aa3a86f372 Exclude metadata from StockLocation and StockItem model resource class 2022-05-18 21:33:40 +10:00
Matthias ecccfbd546 Remove encoding header
Fixes #2996
2022-05-15 20:33:00 +02:00
Oliver Walters 82541ede32 More unit tests
- BuildOrderCancel
- StockItemInstall
- StockItemUninstall
2022-05-04 22:49:21 +10:00
Oliver Walters 5fe2fb615b Style fixes 2022-04-19 20:41:08 +10:00
Oliver Walters 141f6ccbdf Increase unit testing for StockItem API 2022-04-19 20:10:07 +10:00
Oliver Walters fb0b87db3d Further unit test fixes 2022-04-02 12:00:08 +11:00
Oliver Walters 4593b0f412 Unit test fixes 2022-04-02 11:12:54 +11:00
Oliver 0ba71956cd Add unit tests 2022-03-04 00:02:30 +11:00
Matthias 1ff6988ffd remove unneeded assignment 2022-02-20 04:24:13 +01:00
Matthias c84be228f1 remove dead code 2022-02-13 05:08:37 +01:00
Oliver 4a45ba3a44 Fix data mutability issues 2022-01-27 13:37:42 +11:00
Oliver d0aa09337a Simplify creation of serialized stock via the API
- Fixes atomicity issues
- Don't create-then-delete stock items
2022-01-27 12:08:50 +11:00
Oliver 31dbb9563b Add some unit tests for the new endpoint 2021-12-20 21:25:27 +11:00
Oliver fefe39b88d Fixes for unit tests 2021-12-09 10:04:33 +11:00
Oliver 4a453b0a35 Assign multiple stock items to a customer at one 2021-12-09 00:33:45 +11:00
Oliver c36687af22 Add unit test for new API serializer 2021-12-08 23:45:47 +11:00
Oliver 93a240d9c3 Remove the "scheduled_for_deletion" field from the StockItem model
Reverts back to the original behaviour - stock items are just deleted
2021-12-05 18:14:14 +11:00
Matthias d884e62be1 [FR] Confirm to W293
Fixes #2335
2021-11-23 00:28:23 +01:00
Oliver 78ac40083a Fixes for stock api unit tests
- Remove old unit tests
- Require quantity when creating a new stock item
2021-11-05 00:27:26 +11:00
Oliver 95e7cc7a5d Fixes for unit tests 2021-10-06 08:56:24 +11:00
Oliver 62e62af5fc PEP style fixes 2021-09-28 10:41:30 +10:00
Oliver d9704f4123 Add unit test for deleting stock items via the API 2021-09-28 10:41:03 +10:00
Oliver 9c9407b1ab Add unit test for catching bug
- Turns out that in an image was uploaded with more than ~2000 vertical pixels it would crash
- Smaller images worked fine?
2021-08-25 14:48:45 +10:00
Oliver bb8b85c375 Separate purchase_price and purchase_price_currency for StockItem serializer
- Add "purchase_price_string" for a read-only stringified representation
- Unit testing
2021-08-23 21:44:12 +10:00
Oliver 30fd3c8841 Unit test fixes 2021-07-12 22:03:36 +10:00
Oliver Walters 7505d7b3c5 Unit test fixes 2021-06-27 00:47:12 +10:00
matmair 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
Oliver Walters 90feb6d210 Server-side paginatino for build orders 2021-02-28 20:31:01 +11:00
Oliver Walters b315b958b0 PEP fixes 2021-02-27 07:56:38 +11:00
Oliver Walters 9d099c81a7 Refactor API tests for stock 2021-02-26 21:53:54 +11:00
eeintech 2f78c7c036 Updated stock tests quantities 2021-01-08 14:05:53 -05:00
Oliver Walters 7ac7e8f969 Fixed unit test 2021-01-06 23:38:01 +11:00
Oliver Walters 9dc9c0fcb7 Auto-populate expiry date for stockitem when created via the API
(Now with unit testing!)
2021-01-05 00:21:26 +11:00
Oliver Walters d1ce0f062e Improve unit testing for StockItem API 2021-01-04 01:22:43 +11:00
Oliver Walters ae7fbd6112 Add PEP8-naming extension for flake
- Enforcing python naming checks
2020-11-12 21:53:04 +11:00
Oliver Walters 3c175a6c8d Update creation of StockItem via API
- If no location is specified, but a default location exists for the part, use that
- If a location is specified (even if it is null) then the specified value is used instead
2020-10-18 22:24:45 +11:00
Oliver Walters 3f59ce3f93 Update unit tests
- requires the user to actually have the necessary permissions!
2020-10-06 01:30:36 +11:00
Oliver Walters 911727f7b7 Update test fixtures
- Can't assume that pk values will be assigned sensibly!
- Need to hard-code them in
2020-09-02 19:47:07 +10:00
Oliver Walters 59e7474f75 Stock: More unit tests
- Add some more tests (would have caught a bug that was there already, darn it)
2020-08-31 20:09:43 +10:00
Oliver Walters 45556058d2 Allow files to be uploaded alongside a test report
- Attach the file to the stock item
- Link the uploaded attachment to the test report
2020-05-16 22:53:23 +10:00
Oliver Walters 247cfcc514 Add API unit tests 2020-05-16 21:57:41 +10:00
Oliver Walters bc91975f2c Fixes for Stocktransfer API endpoint 2020-04-10 01:01:39 +10:00