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

'LabelTemplate' object has no attribute 'object_to_print' when trying to print/generate label #1

Open
lenielsen opened this issue Jun 16, 2024 · 1 comment

Comments

@lenielsen
Copy link

lenielsen commented Jun 16, 2024

Hey,
I'm struggling to get the plugin to work. Once activated, I am not able to generate / print any labels no matter which template Im using.

`
Traceback (most recent call last):

File "/home/inventree/src/backend/InvenTree/report/api.py", line 271, in print
plugin.print_labels(

File "/home/inventree/src/backend/InvenTree/plugin/base/label/mixins.py", line 155, in print_labels
context = label.get_context(item, request)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

File "/home/inventree/src/backend/InvenTree/report/models.py", line 411, in get_context
plugin.add_label_context(self, self.object_to_print, request, context)
^^^^^^^^^^^^^^^^^^^^

`AttributeError: 'LabelTemplate' object has no attribute 'object_to_print'``

Disabling the plugin fixes the issue.

I have tried to import the example 29mm template. Same result. The issue also appears when trying to use PlatformUI's label preview feature.

# Version Information:
InvenTree-Version: 0.16.0 dev
Django Version: 4.2.12
Commit Hash: 79ea689
Commit Date: 2024-06-16

Database: postgresql
Debug-Mode: False
Deployed using Docker: True
Platform: Linux-6.8.0-76060800daily20240311-generic-x86_64-with
Installer: DOC

Active plugins: [{'name': 'InvenTreeBarcode', 'slug': 'inventreebarcode', 'version': '2.0.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': 'Brother Labels', 'slug': 'brother', 'version': '0.9.0'}, {'name': 'PartTemplatesPlugin', 'slug': 'part-templates', 'version': '0.3.1'}]

Is the plugin compatible with the latest version or only stable? I havent tried the latter.

@turist79
Copy link

Sorry for hi-jacking your topic, but how did you install the plugin? I tried to do that via web console but get "ERROR: Could not find a version that satisfies the requirement inventree-part-templates (from versions: none)" message. I suppose that "Source URL" pointing to the github should be be provided but i have quite few experience with the github and it does not work for me unfortunately.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants