* Fix bug in loading setting from cache
- Need to bring out "cache" key first, otherwise it gets included in the calculated cache key
- Reference: https://github.com/inventree/InvenTree/issues/5586
* Unit test fixes
(cherry picked from commit 87a8755e1b1d0b7853878e1725b06abc2ed54a28)
Co-authored-by: Oliver <oliver.henry.walters@gmail.com>
- Significantly improves performance of users.models.update_group_roles() function
- Ref: https://github.com/inventree/InvenTree/pull/5612
(cherry picked from commit 200bc5bd3d56ca2c1cd1a7cedab63e4cce0f5b5f)
Co-authored-by: Oliver <oliver.henry.walters@gmail.com>
Co-authored-by: Oliver Lippert <oliver@lipperts-web.de>
(cherry picked from commit 2f0dbf97768e7dbae495216969a3fe35b2cb2b8f)
Co-authored-by: Oliver Lippert <oliver@allesit.de>
* Improve management of primary address for a company
- Simplify approach (remove "confirm_primary" field)
- Remove @receiver hook
- Move all logic into Address.save() method
* Make address primary if it is the only one defined for a company
* Update frontend table
* Fix saving logic
* Actually fix it this time
* Fix for unit test
* Another test fix
(cherry picked from commit 324d5929b56b3f17a36ff85a792c5b22fef517df)
Co-authored-by: Oliver <oliver.henry.walters@gmail.com>
- When a BomItem is created or edited, update any active build orders which use it
- Runs as a background task
- Fixes https://github.com/inventree/InvenTree/issues/5541
(cherry picked from commit c8021ec319a7a1d06cc96a156e66ea1adb77ac42)
Co-authored-by: Oliver <oliver.henry.walters@gmail.com>
* Fix missing filters for get settings validator (#5480)
* Fix missing filters for get settings validator
* merge default model instance filters and kwargs
* Added tests for validators
* Give it a try without the kwargs passed to clean in save function
* Added string for identification for debug statement
* Added more debug comments
* Added more debug prints
* Fix test debug
* Modiefied workflow
* trigger ci
* Fix test and remove unused kwargs
* Added debug prints
* Only run one test in ci
* Added more debug code
* Remove all debug prints and reset workflow
* Reset overlooked file
(cherry picked from commit 9a6c2d2953adebda8a7ca0262cd3e1f3bb2e7c6a)
# Conflicts:
# InvenTree/plugin/samples/integration/test_sample.py
* Add missing import
* Added second missing import
* Handle login without supplier user
- Use custom login form
- Redirect back to login page
- No longer throws error
* Fix method return
(cherry picked from commit 71ad4a1c99c35d6922c8c2f3b24bf9858db29bcd)
Co-authored-by: Oliver <oliver.henry.walters@gmail.com>
* Use urljoin function to construct absolute URL
* Add unit test
(cherry picked from commit 8da5d62c6983addbe04a4c0aae4eddac91d873d1)
Co-authored-by: Oliver <oliver.henry.walters@gmail.com>
- Ensure <td> tag is closed correctly
(cherry picked from commit e7b5b145bfe5e1566080e9d6b8e67f44e872374d)
Co-authored-by: Oliver <oliver.henry.walters@gmail.com>
- Does not work with custom backend
- Throws error if the button is pressed
- So, remove the button
(cherry picked from commit a2f614ad41853b7c45232cb15929e5d217088fd5)
Co-authored-by: Oliver <oliver.henry.walters@gmail.com>
* Catch IndexError when importing data
* Also handle TypeError
(cherry picked from commit 93e4dadb49b1cbe304ed9654af8f9d1d944c112e)
Co-authored-by: Oliver <oliver.henry.walters@gmail.com>
- Check that the database model really does exist in the template code
(cherry picked from commit a8118ed406a1c41986738e4ff6f16b445cbc1b10)
Co-authored-by: Oliver <oliver.henry.walters@gmail.com>
* Fix debug messages
* Fix bug in purchase history chart
- Use new pack_quantity_native attribute
(cherry picked from commit 86ca0b27a42a1dc2dea8034444ea1b30d1fd9ca0)
Co-authored-by: Oliver <oliver.henry.walters@gmail.com>
* fix cli on 22.04 (#5204)
(cherry picked from commit d4fad4f5c8028cf7eaf49c61416e0b68be6947b4)
* Update weasyprint docs link
* Another link fix
---------
Co-authored-by: Matthias Mair <code@mjmair.com>
- Creation of BuildItem objects was using old model references
(cherry picked from commit 668dab4175a2de227c1bb0f8ef3f78100f81e903)
Co-authored-by: Oliver <oliver.henry.walters@gmail.com>
* add error log on SSO check failure
* sso_check_provider: fix by comparing against id
the name is the pretty printed version which not necessarily is the same
as the provider id it is compared against. This fails e.g. for the
microsoft allauth extension where the id is microsoft, but the name is
"Microsoft Graph".
Closes: #5330
(cherry picked from commit ee5416719f2df683e10a94840840389c088460de)
Co-authored-by: Hendrik v. Raven <hendrik@consetetur.de>
- Other request methods need love too!
(cherry picked from commit 59ffdcaa1906f306378984d12cc40f61c7b80621)
(cherry picked from commit b89a120f9e673845e67ad6729bddb6a77974472d)
Co-authored-by: Oliver <oliver.henry.walters@gmail.com>
- Re-throw as a ValidationError
- Results in a 400 error, not a 500
(cherry picked from commit 5f3d3b28b367e4ead79aeafc34c8c8da4d7564cf)
Co-authored-by: Oliver <oliver.henry.walters@gmail.com>
- Add "get_fields()" method to InvenTreeResource
- Override default behaviour and exclude some common fields
- Will flow down to any inheriting classes
(cherry picked from commit 941451203a3d9a9ef2c522aba19cdbaaa140e05a)
Co-authored-by: Oliver <oliver.henry.walters@gmail.com>
* Change for DEFAULT_FROM_EMAIL
- Use USERNAME if not specified
(cherry picked from commit 487ac917c90e9fe3da4effaa9326b707ceecd321)
* Email configuration fails if DEFAULT_FROM_EMAIL not set
(cherry picked from commit 01e573c3a2702e7c21ed13b0cb44280c89d3dee1)
* Docs update
(cherry picked from commit bfedb9cf87dbbf8024412afa6454361d45afe967)
Co-authored-by: Oliver <oliver.henry.walters@gmail.com>
- Has to be lowercase in settings.py to work correctly
(cherry picked from commit 20b59c35752fdcae25578ab5399efaa96080f27f)
Co-authored-by: Oliver <oliver.henry.walters@gmail.com>
- Handles case where null or invalid value provided
(cherry picked from commit 41167f22c9943a2a0f389fd24f595f137bf2271f)
Co-authored-by: Oliver <oliver.henry.walters@gmail.com>