2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-06-18 04:55:44 +00:00

Typed report context (#9431)

* add typed report context

* make it py3.9 compatible

* fix docs

* debug docs

* fix for py 3.9

* add requested error codes
This commit is contained in:
Lukas
2025-04-02 22:45:37 +02:00
committed by GitHub
parent b2db0b67e0
commit 75b47f8d09
16 changed files with 581 additions and 154 deletions

View File

@ -22,6 +22,16 @@ Raise an issue if none of these options work.
The used invoke executable is the wrong one. InvenTree needs to have
You probably have a reference to invoke or a directory with invoke in your PATH variable that is not in InvenTrees virtual environment. You can check this by running `which invoke` and `which python` in your installations base directory and compare the output. If they are not the same, you need to adjust your PATH variable to point to the correct virtual environment before it lists other directories with invoke.
#### INVE-E3
**Report Context use custom QuerySet**
As the `django.db.models.QuerySet` is not a generic class, we would loose type information without `django-stubs`. Therefore use the `report.mixins.QuerySet` generic class when typing a report context.
#### INVE-E4
**Model missing report_context return type annotation**
Models that implement the `InvenTreeReportMixin` must have an explicit return type annotation for the `report_context` function.
### INVE-W (InvenTree Warning)
Warnings - These are non-critical errors which should be addressed when possible.