-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Report tag fixes #10668
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Report tag fixes #10668
Conversation
- Enable conversion of non-money values to a Money instance
- Convert values to Decimal - Ability to cast result to different type
✅ Deploy Preview for inventree-web-pui-preview canceled.
|
…ee into report-tag-fixes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR enhances the custom math tags for report generation with improved error handling and type conversion. It converts mathematical operations to use Decimal instead of float for better precision, adds a cast parameter for type conversion, and ensures errors are properly reported to users rather than causing silent failures.
Key changes:
- Replaced float-based math operations with Decimal-based operations for better precision
- Added
castparameter to math tags for explicit type conversion control - Changed error handling from generic exceptions to ValidationError with descriptive messages
Reviewed Changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| src/frontend/src/components/forms/ApiForm.tsx | Filters out empty and 'None' error messages from form validation display |
| src/backend/InvenTree/report/test_tags.py | Updates tests to use Decimal types and ValidationError expectations |
| src/backend/InvenTree/report/templatetags/report.py | Replaces destringify with make_decimal and adds robust error handling with cast parameter support |
| src/backend/InvenTree/report/models.py | Adds ValidationError exception handling to preserve error messages during report rendering |
| src/backend/InvenTree/InvenTree/templatetags/inventree_extras.py | Removes duplicate add function definition |
| src/backend/InvenTree/InvenTree/helpers_model.py | Adds multiplier parameter and converts non-Money values to Money objects |
| docs/docs/report/helpers.md | Updates documentation to reflect Decimal usage instead of float |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #10668 +/- ##
==========================================
- Coverage 87.86% 87.84% -0.02%
==========================================
Files 1276 1276
Lines 57426 57478 +52
Branches 2031 2031
==========================================
+ Hits 50456 50493 +37
- Misses 6470 6485 +15
Partials 500 500
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
Issues attributed to commits in this pull requestThis pull request was merged and Sentry observed the following issues:
|
Enhancements to custom maths tags for report generation: