Skip to content

Conversation

@SchrodingersGat
Copy link
Member

@SchrodingersGat SchrodingersGat commented Oct 24, 2025

Enhancements to custom maths tags for report generation:

@SchrodingersGat SchrodingersGat added this to the 1.1.0 milestone Oct 24, 2025
@SchrodingersGat SchrodingersGat added enhancement This is an suggested enhancement or new feature report Report/Label generation labels Oct 24, 2025
@netlify
Copy link

netlify bot commented Oct 24, 2025

Deploy Preview for inventree-web-pui-preview canceled.

Name Link
🔨 Latest commit 524e2c3
🔍 Latest deploy log https://app.netlify.com/projects/inventree-web-pui-preview/deploys/68fc289962dcd40008b3a97d

Copy link
Contributor

Copilot AI left a 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 cast parameter 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
Copy link

codecov bot commented Oct 25, 2025

Codecov Report

❌ Patch coverage is 86.51685% with 12 lines in your changes missing coverage. Please review.
✅ Project coverage is 87.84%. Comparing base (a2682a7) to head (524e2c3).
⚠️ Report is 1 commits behind head on master.

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              
Flag Coverage Δ
backend 89.58% <86.51%> (-0.02%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
Backend Apps 91.94% <84.81%> (-0.03%) ⬇️
Backend General 93.66% <ø> (ø)
Frontend 70.05% <ø> (-0.01%) ⬇️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@SchrodingersGat SchrodingersGat merged commit 8e1d621 into inventree:master Oct 25, 2025
35 checks passed
@SchrodingersGat SchrodingersGat deleted the report-tag-fixes branch October 25, 2025 02:17
@sentry
Copy link

sentry bot commented Oct 26, 2025

Issues attributed to commits in this pull request

This pull request was merged and Sentry observed the following issues:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement This is an suggested enhancement or new feature report Report/Label generation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant