* 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>
* Hide protected setting in settings view
* Implement custom serializer for setting value
- Return '***' if the setting is protected
* Implement to_internal_value
* Stringify
* Add protected setting to sample plugin
* Unit tests for plugin settings API
* Update unit test
(cherry picked from commit 01f2aa5f746a36706e9a5e588c4242b7bf1996d5)
Co-authored-by: Oliver <oliver.henry.walters@gmail.com>
- Allocation check only applies to untracked line items
(cherry picked from commit 1f81daadf6c029afb5ee0ee51e3bcd6d40adacd3)
Co-authored-by: Oliver <oliver.henry.walters@gmail.com>
* Fix quantity aggregation for stock table
- Stock quantity can only be added together if units are the same
* Add stock total footer to part table
(cherry picked from commit 773dd3b210a61bd00669675e5ce72d7f150f5233)
Co-authored-by: Oliver <oliver.henry.walters@gmail.com>
* Handle AttributeError in convert_physical_value
* Added new unit test
(cherry picked from commit 9abcc0ec34cdcaade7047965da45ff47be14b294)
Co-authored-by: Oliver <oliver.henry.walters@gmail.com>