Skip to content

'LabelTemplate' object has no attribute 'object_to_print'  #7546

Closed

Description

@SergeoLacruz

Please verify that this bug has NOT been raised before.

  • I checked and didn't find a similar issue

Describe the bug*

Label printing shown Form errors as shown in the enclosed screenshot. I tried with different label templates and printer settings. Always the same.

Steps to Reproduce

Select a part
print a pabel
label

Expected behaviour

usually a popup comes with the label

Deployment Method

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

Version Information

InvenTree Version 0.16.0 dev
Development Version
Commit Hash ade6cfb
Commit Date 2024-07-02
Commit Branch master

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

  • I can reproduce this bug on the demo site.

Relevant log output

Event triggered: 'report_labeloutput.created'
Enqueued [InvenTree] 692062
Pushed ('artist-eight-twelve-cup', 'df01ff2b7d6d426992530b28fb9f5b11')
Event triggered: 'report_labeloutput.saved'
Enqueued [InvenTree] 692063
Pushed ('winner-east-echo-india', '7703b83a73b441be8ad721452c343a41')
Checking plugin registry hash
'LabelTemplate' object has no attribute 'object_to_print'
Gathering users for notification 'inventree.error_log'
Sending notification 'inventree.error_log' for 'Error object (333)'
Triggering notification method 'ui_message'
Notify users via 'ui_message' for notification 'inventree.error_log' for 'Error object (333)'
Notified 7 users via 'ui_message' for notification 'inventree.error_log' for 'Error object (333)' successfully
Bad Request: /api/label/print/
Bad Request: /api/label/print/
[02/Jul/2024 06:02:32] "POST /api/label/print/ HTTP/1.1" 400 105
[02/Jul/2024 06:02:32] "GET /api/notifications/?read=false HTTP/1.1" 200 14435


raceback (most recent call last):

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

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

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

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

Activity

  1. added
    bug
    question
    triage:not-checked
    on Jul 2, 2024
  2. removed
    question
    triage:not-checked
    on Jul 2, 2024
  3. added this to the 0.16.0 milestone on Jul 2, 2024
  4. SchrodingersGat commented on Jul 2, 2024

    @SchrodingersGat
    Member

    @SergeoLacruz thanks for reporting this, fix incoming in #7548

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions