InvenTree/InvenTree/plugin
Oliver 0f445ea6e4
[Feature] Stocktake reports (#4345)
* Add settings to control upcoming stocktake features

* Adds migration for "cost range" when performing stocktake

* Add cost data to PartStocktakeSerializer

Implement a new custom serializer for currency data type

* Refactor existing currency serializers

* Update stocktake table and forms

* Prevent trailing zeroes in forms

* Calculate cost range when adding manual stocktake entry

* Display interactive chart for part stocktake history

* Ensure chart data are converted to common currency

* Adds new model for building stocktake reports

* Add admin integration for new model

* Adds API endpoint to expose list of stocktake reports available for download

- No ability to edit or delete via API

* Add setting to control automated deletion of old stocktake reports

* Updates for settings page

- Load part stocktake report table
- Refactor function to render a downloadable media file
- Fix bug with forcing files to be downloaded
- Split js code into separate templates
- Make use of onPanelLoad functionalitty

* Fix conflicting migration files

* Adds API endpoint for manual generation of stocktake report

* Offload task to generate new stocktake report

* Adds python function to perform stocktake on a single part instance

* Small bug fixes

* Various tweaks

- Prevent new stocktake models from triggering plugin events when created
- Construct a simple csv dataset

* Generate new report

* Updates for report generation

- Prefetch related data
- Add extra columns
- Keep track of stocktake instances (for saving to database later on)

* Updates:

- Add confirmation message
- Serializer validation checks

* Ensure that background worker is running before manually scheduling a new stocktake report

* Add extra fields to stocktake models

Also move code from part/models.py to part/tasks.py

* Add 'part_count' to PartStocktakeReport table

* Updates for stocktake generation

- remove old performStocktake javascript code
- Now handled by automated server-side calculation
- Generate report for a single part

* Add a new "role" for stocktake

- Allows fine-grained control on viewing / creating / deleting stocktake data
- More in-line with existing permission controls
- Remove STOCKTAKE_OWNER setting

* Add serializer field to limit stocktake report to particular locations

* Use location restriction when generating a stocktake report

* Add UI buttons to perform stocktake for a whole category tree

* Add button to perform stocktake report for a location tree

* Adds a background tasks to handle periodic generation of stocktake reports

- Reports are generated at fixed intervals
- Deletes old reports after certain number of days

* Implement notifications for new stocktake reports

- If manually requested by a user, notify that user
- Cleanup notification table
- Amend PartStocktakeModel for better notification rendering

* Hide buttons on location and category page if stocktake is not enabled

* Cleanup log messages during server start

* Extend functionality of RoleRequired permission mixin

- Allow 'role_required' attribute to be added to an API view
- Useful when using a serializer class that does not have a model defined

* Add boolean option to toggle whether a report will be generated

* Update generateStocktake function

* Improve location filtering

- Don't limit the actual stock items
- Instead, select only parts which exist within a given location tree

* Update API version

* String tweaks

* Fix permissions for PartStocktake API

* More unit testing for stocktake functionality

* QoL fix

* Fix for assigning inherited permissions
2023-02-17 11:42:48 +11:00
..
base [Feature] Stocktake reports (#4345) 2023-02-17 11:42:48 +11:00
builtin [BUG] Plugin Schedule do not update when beeing changed + plugin testing (#4243) 2023-01-25 09:41:20 +11:00
migrations user notification settings 2022-04-04 23:46:19 +02:00
mixins [FR] Slack notifications & notification method updates (#4114) 2023-01-01 09:20:55 +11:00
mock Improve plugin testing (#3517) 2022-08-16 13:09:48 +10:00
samples Plugin schedule fix (#4295) 2023-02-02 23:36:19 +11:00
templatetags [FR] Slack notifications & notification method updates (#4114) 2023-01-01 09:20:55 +11:00
__init__.py BREAKING (#3283) 2022-07-03 12:32:35 +10:00
admin.py Builtin plugins (#3889) 2022-11-05 01:05:54 +11:00
api.py Plugin settings refactor (#4185) 2023-01-27 16:45:14 +11:00
apps.py Plugin schedule fix (#4295) 2023-02-02 23:36:19 +11:00
events.py Docstring checks in QC checks (#3089) 2022-06-02 01:37:39 +10:00
helpers.py Plugin load fix (#3768) 2022-10-11 23:15:24 +11:00
models.py Force builtin plugins to be active (#4276) 2023-01-29 15:44:04 +11:00
plugin.py Builtin plugins (#3889) 2022-11-05 01:05:54 +11:00
registry.py [Feature] Stocktake reports (#4345) 2023-02-17 11:42:48 +11:00
serializers.py [FR] Add API endpoint to activate plugins (#4186) 2023-01-26 07:05:09 +11:00
template.py Plugin framework updates (#3535) 2022-08-16 16:10:18 +10:00
test_api.py Force builtin plugins to be active (#4276) 2023-01-29 15:44:04 +11:00
test_helpers.py Optimisations for editable installs of plugins (#3634) 2022-09-05 13:03:26 +10:00
test_plugin.py [FR] Add API endpoint to activate plugins (#4186) 2023-01-26 07:05:09 +11:00
urls.py Docstring checks in QC checks (#3089) 2022-06-02 01:37:39 +10:00
views.py Ensure an error gets logged when a delivery method fails (#3144) 2022-06-07 08:58:00 +10:00