inventree / inventree-brother-plugin

Label printing plugin for Brother series printers
MIT License
16 stars 12 forks source link

90° Print #23

Closed rieders closed 1 year ago

rieders commented 1 year ago

Hello I have the problem that the Brother QL-820NWB prints very small at 0°. If I set the plugin to 90°, I get an error message from inventree.

So far I have output the print as a PDF and then printed it. Maybe it's also possible directly via the plugin.

20230808_083916

Screenshot 2023-08-08 084321

Greetings

SchrodingersGat commented 1 year ago

@rieders fix incoming, hopefully works for you, I don't have that particular printer to test.

rieders commented 1 year ago

Hello Thank you for the quick change. Do I have to initiate the update myself or does the plugin update itself? If I have to update it myself I would like to know how to do it.

Greetings

SchrodingersGat commented 1 year ago

@rieders you will have to update it yourself. How did you originally install it?

rieders commented 1 year ago

Hello I had it with me

cd /opt/inventory source ./env/bin/activate and then pip install inventory-brother-plugin

Installed. If I run it again, it is downloaded into inventree, but after the restart I still have version 0.70 I think that version 0.71 is the current one.

Greetings

SchrodingersGat commented 1 year ago

If you run pip install -U inventree-brother-plugin it should update to the latest version. Then you'll need to restart your server

rieders commented 1 year ago

Hello Many thanks for the help. I managed to install the current version of the Brother Printer Plugin via another instance on Proxmox. Unfortunately, I immediately get the message that the error details are in the admin panel. After that I get the error message.

Type: TypeError Path: /api/label/part/1/print/ Info: sequence item 0: expected str instance, PosixPath found When:

  1. August 2023 09:44 Data: Traceback (most recent call last):

File "/opt/inventree/env/lib/python3.9/site-packages/rest_framework/views.py", line 506, in dispatch response = handler(request, *args, **kwargs)

File "/opt/inventree/InvenTree/label/api.py", line 152, in get return self.print(request, self.get_items())

File "/opt/inventree/InvenTree/label/api.py", line 238, in print pdf = output.get_document().write_pdf()

File "/opt/inventree/env/lib/python3.9/site-packages/django_weasyprint/views.py", line 76, in get_document string=super().rendered_content,

File "/opt/inventree/env/lib/python3.9/site-packages/django/template/response.py", line 81, in rendered_content template = self.resolve_template(self.template_name)

File "/opt/inventree/env/lib/python3.9/site-packages/django/template/response.py", line 63, in resolve_template return select_template(template, using=self.using)

File "/opt/inventree/env/lib/python3.9/site-packages/django/template/loader.py", line 47, in select_template raise TemplateDoesNotExist(', '.join(template_name_list), chain=chain)

TypeError: sequence item 0: expected str instance, PosixPath found

I thank you for your help. Greetings

SchrodingersGat commented 1 year ago

That's a weird one. Two questions:

rieders commented 1 year ago

Many thanks for your effort With PDF printing, everything looks normal. When I select Brother as printer I get this error message. It doesn't matter which orientation I use, 0 or 90°. Before the change it was still printed at 0°, just too small and at right angles to the label.

90° Error object (55) VERLAUF

Type: TypeError Path: /api/label/part/1/print/ Info: sequence item 0: expected str instance, PosixPath found When:

  1. August 2023 15:04 Data: Traceback (most recent call last):

File "/opt/inventree/env/lib/python3.9/site-packages/rest_framework/views.py", line 506, in dispatch response = handler(request, *args, **kwargs)

File "/opt/inventree/InvenTree/label/api.py", line 152, in get return self.print(request, self.get_items())

File "/opt/inventree/InvenTree/label/api.py", line 268, in print doc = output.get_document()

File "/opt/inventree/env/lib/python3.9/site-packages/django_weasyprint/views.py", line 76, in get_document string=super().rendered_content,

File "/opt/inventree/env/lib/python3.9/site-packages/django/template/response.py", line 81, in rendered_content template = self.resolve_template(self.template_name)

File "/opt/inventree/env/lib/python3.9/site-packages/django/template/response.py", line 63, in resolve_template return select_template(template, using=self.using)

File "/opt/inventree/env/lib/python3.9/site-packages/django/template/loader.py", line 47, in select_template raise TemplateDoesNotExist(', '.join(template_name_list), chain=chain)

TypeError: sequence item 0: expected str instance, PosixPath found

0° Type: TypeError Path: /api/label/part/1/print/ Info: sequence item 0: expected str instance, PosixPath found When:

  1. August 2023 15:07 Data: Traceback (most recent call last):

File "/opt/inventree/env/lib/python3.9/site-packages/rest_framework/views.py", line 506, in dispatch response = handler(request, *args, **kwargs)

File "/opt/inventree/InvenTree/label/api.py", line 152, in get return self.print(request, self.get_items())

File "/opt/inventree/InvenTree/label/api.py", line 238, in print pdf = output.get_document().write_pdf()

File "/opt/inventree/env/lib/python3.9/site-packages/django_weasyprint/views.py", line 76, in get_document string=super().rendered_content,

File "/opt/inventree/env/lib/python3.9/site-packages/django/template/response.py", line 81, in rendered_content template = self.resolve_template(self.template_name)

File "/opt/inventree/env/lib/python3.9/site-packages/django/template/response.py", line 63, in resolve_template return select_template(template, using=self.using)

File "/opt/inventree/env/lib/python3.9/site-packages/django/template/loader.py", line 47, in select_template raise TemplateDoesNotExist(', '.join(template_name_list), chain=chain)

TypeError: sequence item 0: expected str instance, PosixPath found

rieders commented 1 year ago

addendum If I use an original template, the . but nothing is pressed Screenshot 2023-08-13 172403

When I use a modified template I get the error message.

Screenshot 2023-08-13 170232

Screenshot 2023-08-13 114038

SchrodingersGat commented 1 year ago

What version of InvenTree are you running?

rieders commented 1 year ago

Version 0.12.7 Build 74

Oliver @.***> schrieb am Di., 15. Aug. 2023, 01:33:

What version of InvenTree are you running?

— Reply to this email directly, view it on GitHub https://github.com/inventree/inventree-brother-plugin/issues/23#issuecomment-1678225512, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABHPOZ6DONJB4NEQWK3UOI3XVKYT7ANCNFSM6AAAAAA3H7SFHI . You are receiving this because you were mentioned.Message ID: @.***>

SchrodingersGat commented 1 year ago

That's the version for the app - but what about for the InvenTree server?

rieders commented 1 year ago

sorry Version 0.12.3