Commit Graph

639 Commits

Author SHA1 Message Date
Matthias Mair e83995b4f5
Add bleach (#41) (#3204)
* use shims for API view inheritation

* Add mixin for input sanitation

* fix clean operation to fix all string values

* Also clean up dicts
this is to future-proof this function

* Update docstirng

* proof custom methods against XSS through authenticated users
2022-06-16 10:01:53 +10:00
Oliver 57563f6b7a
Merge pull request from GHSA-7rq4-qcpw-74gq
* Create custom ModelResource subclass

- Strips illegal starting characters from string cells
- Prevents formula injection

* Update all existing ModelResource classes to base off InvenTreeResource

* Handle more complex case where an illegal char is hidden behind another one
2022-06-15 18:32:35 +10:00
Oliver 258957c14c
SupplierPart availability (#3148)
* Adds new fields to the SupplierPart model:

- available
- availability_updated

* Allow availability_updated field to be blank

* Revert "Remove stat context variables"

This reverts commit 0989c308d0.

* Increment API version

* Adds availability information to the SupplierPart API serializer

- If the 'available' field is updated, the current date is added to the availability_updated field

* Add 'available' field to SupplierPart table

* More JS refactoring

* Add unit testing for specifying availability via the API

* Display availability data on the SupplierPart detail page

* Add ability to set 'available' quantity from the SupplierPart detail page

* Revert "Revert "Remove stat context variables""

This reverts commit 3f98037f79.
2022-06-08 21:49:07 +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 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 2074bf9156
Fix broken delete button (#3116)
* Fix broken delete button

* Fix filtering for purchaseorder table on supplierpart page

(cherry picked from commit 77fb02ff39)
2022-06-02 15:00:09 +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 2d1776a151
Refactor 'DeleteManufacturerPart' form (#3067)
* Refactor 'DeleteManufacturerPart' form

- Remove duplicated forms
- Update style to match other forms
- Block on each deletion before progressing to the next one

* PEP fix

* Adds deleteSupplierParts function

* Refactor all instances of supplier part deletion

* Refactor tractor : use convenience function for bootstraptable.getSelections

* Add deleter for manufacturerpartparameter.

Refactor existing code into a single function

* Refactor deletion for stock items

* JS linting
2022-05-25 23:35:53 +10:00
Matthias Mair 5805685c48 Merge branch 'master' of https://github.com/inventree/InvenTree into style-fixes 2022-05-21 23:57:41 +02:00
Matthias Mair a148dbf303 refactor 'all' role 2022-05-20 17:43:51 +02:00
Matthias Mair e1d22f538d resort imports 2022-05-20 17:24:51 +02:00
Matthias Mair 74726f0fda fix endline 2022-05-20 13:35:07 +02:00
Matthias Mair 93b6934127 fix trailing 2022-05-20 13:20:55 +02:00
Matthias Mair 9f922f06ff fix more imports 2022-05-20 12:53:04 +02:00
Matthias Mair e8287f02d4 rename 2022-05-20 12:33:51 +02:00
Matthias Mair 42d325e7ca fix spelling 2022-05-20 12:33:28 +02:00
Matthias Mair 3a1996dd48 PEP fix 2022-05-20 12:32:25 +02:00
Matthias Mair 0d5dea3e6d refactor test setup 2022-05-20 12:12:32 +02:00
Kálmán Rózsahegyi 9e8da0e8e0 Fix manufacturer part detail template with missing company view tests 2022-05-18 22:20:42 +02:00
Jakob Haufe ed1cc1209e
Add admin class 2022-05-18 13:25:01 +02:00
Jakob Haufe 72f330ab75
Add JS 2022-05-18 13:25:00 +02:00
Jakob Haufe c6d3cd9bae
Add content panel 2022-05-18 13:25:00 +02:00
Jakob Haufe fc3e61df24
Add sidebar item 2022-05-18 13:24:59 +02:00
Jakob Haufe 09a7627788
Add API URLs 2022-05-18 13:24:59 +02:00
Jakob Haufe 69ba271bf7
Add API endpoints 2022-05-18 13:24:58 +02:00
Jakob Haufe 3ee32374b4
Add serializer 2022-05-18 13:24:58 +02:00
Jakob Haufe c608778a1b
Add migration 2022-05-18 13:24:57 +02:00
Jakob Haufe 67c675d1a6
Add ManufacturerPartAttachment class 2022-05-18 13:24:50 +02:00
Oliver 9bcbaaa5f5 Remove more python2 stuff 2022-05-17 16:57:31 +10:00
Oliver c51f052f25
Merge pull request #3011 from matmair/matmair/issue2996
Remove python 2 code
2022-05-17 00:51:31 +10:00
Matthias ecccfbd546
Remove encoding header
Fixes #2996
2022-05-15 20:33:00 +02:00
Matthias 77aeecf23a
make operators simpler 2022-05-15 17:52:23 +02:00
Oliver Walters 06e79ee91b Move view mixin to plugin.views 2022-05-07 22:34:03 +10:00
Oliver Walters 60f799c90a Add plugin view support for most of the remaining views 2022-05-06 23:32:42 +10:00
Matthias 055b9c9a46
remove duplicate endif 2022-05-04 13:57:35 +02:00
Matthias 5435cd28c9
redirect to index if company was deleted 2022-05-04 12:39:56 +02:00
Matthias 00dffd953b
add messages if company was deleted 2022-05-04 12:39:12 +02:00
Matthias 1a3d482e42
Merge branch 'master' of https://github.com/inventree/InvenTree into matmair/issue2788 2022-05-04 12:33:21 +02:00
Oliver Walters f3e8edaf1f Refactor for SupplierPart detail page 2022-05-03 17:21:33 +10:00
Oliver Walters 05b01e4d6c Refactor order parts for manfuacturer part detail page 2022-05-03 17:16:38 +10:00
Oliver Walters 28f3244574 Order parts from "supplier parts" page
- Prevent duplicate parts from loading
2022-05-03 16:52:23 +10:00
Oliver Walters c0163a476f Refactor 'order parts' window from manufacturer part list 2022-05-03 16:42:00 +10:00
Oliver Walters 4732efb330 Fix callbacks for adding new supplier part and/or purchase order "inline" 2022-05-03 11:42:13 +10:00
Matthias e7b189ba29
fix templates 2022-05-02 22:41:24 +02:00
Matthias Mair 0c338cb2ae
Merge branch 'inventree:master' into matmair/issue2788 2022-05-02 21:50:57 +02: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
Matthias 93a05491ce
PEP fix 2022-05-01 00:17:07 +02:00
Matthias 58901a8cf6
fix migrations 2022-05-01 00:15:02 +02:00