-
-
Notifications
You must be signed in to change notification settings - Fork 939
[Report] Generate single report against selected items #9423
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
Comments
@tristanle22 FYI |
I'm working on this feature. Just have a dump question as I'm not very familiar with the matter :). Currently I'm adding the "merge" field as a Boolean. If the user want to set this field (or any other field) to True in the report template, how would they do it? |
@tristanle22 great question. Here's a rough sequence of required steps:
Add the new field name to the
This will ensure that the new field is exposed to the API
Add your new field name to the InvenTree/src/frontend/src/pages/Index/Settings/AdminCenter/ReportTemplatePanel.tsx Line 7 in 67bdf31
That should be sufficient to allow the user to edit this new field. LMK how you go! |
Thanks @SchrodingersGat for the instructions! I have followed your steps above. After making the changes, I ran debug with vscode, however, the new field doesn't show up. Is anything else I need to do before running? From a quick search, this autogenerated field is missing the new field: src/backend/InvenTree/report/migrations/0022_reporttemplate.py. Not sure if it has any signficance. |
In vscode you'll need two processes running: Backend Server
Frontend Dev Server (with auto-reload)
And then access at |
Ah I see. Thanks for your help! I can see the changes in the front end now. |
After running dev.setup-test to load the sample dataset, I was able to login to http://localhost:8000 with user 'admin' and pw 'inventree'. However, the same credentials didn't work on http://localhost:5173. Do you have any idea why? @SchrodingersGat |
Probably due to CORS issues - have a look at the network response in your browser when you try to login. By default the devcontainer setup should work seamlessly with the |
No I didn't do anything "non-standard", beside having to manually install psycopg since it was missing from src/backend/requirements.txt. After restarting the devcontainer docker image, I was able to login to localhost:5173. |
Discussed in #9408
Originally posted by tristanle22 March 30, 2025
I want to select a few stock items and generate a report. In the report, I want to have a table, with each row for each stock item. I can't find a context variable that represents a list of selected stock items.
I'm aware of the built-in "Inventree Test Report" generates a new page for each selected item.
Feature Description
Instead of generating a separate report for each individually selected item (e.g. stock item / order / part), add an option to pass all selected items through to the report context, and then generate a single report from that.
Implementation Ideas
The
ReportTemplate
model has an existingprint
method which could be overloaded:InvenTree/src/backend/InvenTree/report/models.py
Line 351 in 66d5180
Simply replace this iterator:
InvenTree/src/backend/InvenTree/report/models.py
Line 403 in 66d5180
The text was updated successfully, but these errors were encountered: