Skip to content
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

Label Printer Template Selection has no Default Value in Label Printing Modal #8347

Open
3 of 6 tasks
simonkuehling opened this issue Oct 23, 2024 · 1 comment
Open
3 of 6 tasks
Labels
bug Identifies a bug which needs to be addressed question This is a question

Comments

@simonkuehling
Copy link
Contributor

Please verify that this bug has NOT been raised before.

  • I checked and didn't find a similar issue

Describe the bug*

as a follow-up on #8313 (mentioned by @SergeoLacruz) there is another issue with the Label Printer Modal form: currently no template is selected by default in the form - which is another two clicks for each printing operation.

I have looked into fixing this, but cannot figure out how to access the template field options for setting a value: in https://github.com/simonkuehling/InvenTree/blob/cb0248d15944544d66b5b047b905275d76954a00/src/frontend/src/components/buttons/PrintingActions.tsx#L60-L67

Happy to create a PR for it if someone could give me a hint on this!

Steps to Reproduce

  1. open a Part/StockItem/etc
  2. click "print label" action button

Expected behaviour

pre-select the drop down with the first template

Deployment Method

  • Docker
  • Package
  • Bare metal
  • Other - added info in Steps to Reproduce

Version Information

InvenTree-Version: 0.17.0 dev
Django Version: 4.2.16
Commit Hash: 17bf7bb
Commit Date: 2024-10-18
Commit Branch: null
Database: postgresql
Debug-Mode: False
Deployed using Docker: True
Platform: Linux-6.1.0-rpi7-rpi-v8-aarch64-with
Installer: DOC
nullActive plugins: [{"name":"InvenTreeBarcode","slug":"inventreebarcode","version":"2.1.0"},{"name":"InvenTreeCoreNotificationsPlugin","slug":"inventreecorenotificationsplugin","version":"1.0.0"},{"name":"InvenTreeCurrencyExchange","slug":"inventreecurrencyexchange","version":"1.0.0"},{"name":"InvenTreeLabel","slug":"inventreelabel","version":"1.1.0"},{"name":"InvenTreeLabelMachine","slug":"inventreelabelmachine","version":"1.0.0"},{"name":"InvenTreeLabelSheet","slug":"inventreelabelsheet","version":"1.0.0"},{"name":"DigiKeyPlugin","slug":"digikeyplugin","version":"1.0.0"},{"name":"LCSCPlugin","slug":"lcscplugin","version":"1.0.0"},{"name":"MouserPlugin","slug":"mouserplugin","version":"1.0.0"},{"name":"TMEPlugin","slug":"tmeplugin","version":"1.0.0"},{"name":"IPNAutoGenerator","slug":"ipnautogenerator","version":null},{"name":"OrderNotesTemplates","slug":"ordernotestemplates","version":null},{"name":"Brother Labels","slug":"brother","version":"1.0.0"}]

Please verify if you can reproduce this bug on the demo site.

  • I can reproduce this bug on the demo site.

Relevant log output

No response

@simonkuehling simonkuehling added bug Identifies a bug which needs to be addressed question This is a question triage:not-checked Item was not checked by the core team labels Oct 23, 2024
@matmair matmair removed the triage:not-checked Item was not checked by the core team label Oct 23, 2024
@SchrodingersGat
Copy link
Member

SchrodingersGat commented Oct 28, 2024

This could be fixed by implementing the "auto-fill" attribute that we have in the legacy user interface:

Basically, for fields with this attribute, the form will send off an API request to the server, with the provide field filters. If one (and only one) result is returned, then the value is populated into the field.

This is how it was achieved in CUI previously, but I think that the behaviour has regressed after we recently refactored how report templates are handled

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Identifies a bug which needs to be addressed question This is a question
Projects
None yet
Development

No branches or pull requests

3 participants