Open PDF Reports and PDF Attachments in Browser

by ,
Odoo 16
v 16.0 Third Party 14123
Download for v 16.0 Deploy on Odoo.sh Live Preview
Availability
Odoo Online
Odoo.sh
On Premise
Lines of code 183
Technical Name prt_report_attachment_preview
LicenseLGPL-3
Websitehttps://cetmix.com
Versions 10.0 15.0 11.0 12.0 13.0 14.0 16.0 17.0
You bought this module and need support? Click here!
Availability
Odoo Online
Odoo.sh
On Premise
Lines of code 183
Technical Name prt_report_attachment_preview
LicenseLGPL-3
Websitehttps://cetmix.com
Versions 10.0 15.0 11.0 12.0 13.0 14.0 16.0 17.0

[ Open PDF Reports in browser ]

Preview in browser instead of downloading

[ MAIN FEATURES ]

  • Preview PDF reports in browser instead of downloading
  • Download reports later from browser if you need
    [filename will be preserved]
  • Note: You must enable pop-up windows for Odoo when prompted!
 

MESSAGING
APPS >

Information flow management is easier than you could imagine _

Version available

[

Mail Messages
Easy

]

View and manage all Odoo messages in one place
just like with a regular email client _
Version available

[

E-mail Fields Tweaks

]

Customize outgoing e-mail fields _
Version available
App extension

[

Messages
Drafts

]

Save message as draft to send it later _
Version available
App extension

[

Messages
Filter

]

Odoo messages filter and anti-spam protection _
 

POINT
OF SALE >

Improve retail sales efficiency _

 

[

PoS Stock Available Online

]

Show available product quantities
directly in Point of Sale _
 

[

PoS
Product Quick Info

]

Click on a smart button on the product tile to get information instantly _
 

[

PoS
Re-order
App

]

Create a new Point of Sale order
from an existing one _
 

INVENTORY
APPS >

Simplify and streamline your inventory management _


Version available

[

Reordering
Rules
Templates

]

Manage multiple reordering rules
at once using flexible groups _
 

[

Product
Tweaks
SKU

]

Generate SKU's/default codes for products based on category and attributes _
 

[

Multiple
Product
SKU's

]

Use multiple SKU's
for a single product _
 

CONTACT
MANAGEMENT >

For advanced communications _

Version available

[

Contact
Groups

]

Easily manage contact groups
using special menu _
Version available

[

Advanced
Contacts

]

Multiple Email addresses and phone numbers per partner.
Export contact using QR code _
 

PRODUCTIVITY
APPS >

Boost up your productivity _

Version available

[

Odoo
UML
Export

]

Export Odoo module hierarchy and structure
into PlantUML _
Version available

[

Scheduled
Actions
Shortcuts

]

Launch scheduled actions
directly from Odoo system tray _
 

SUPPORT_


  • Tested on Odoo Community and Odoo Enterprise

  • German, Spanish language translations

  • English, German and Italian language support

 

CETMIX IS NOT JUST ANOTHER IT COMPANY >

We know how the business works. Our experts have management experience in heavy machinery, energy sector, logistics, accounting, public services and many other industries _

We are the people of business
 

SOLUTIONS RIGHT FOR YOUR BUSINESS

Choose an existing one or we can develop a custom one for you

>9
years

of Odoo experience

> 15 000
downloads

of our apps from Odoo App Store

>100
clients

are happy with our services
 

Need support, customization
or interested in collaboration ?


https://cetmix.com/

https://www.linkedin.com/company/cetmix/

https://github.com/cetmix/

https://www.facebook.com//cetmixteam

https://twitter.com/cetmix_team

Please log in to comment on this module

  • The author can leave a single reply to each comment.
  • This section is meant to ask simple questions or leave a rating. Every report of a problem experienced while using the module should be addressed to the author directly (refer to the following point).
  • If you want to start a discussion with the author, please use the developer contact information. They can usually be found in the description.
Please choose a rating from 1 to 5 for this module.
don't close wizars window
by
Oleg Sheremereevich
on 5/3/24, 5:25 AM

Hello. 

Some odoo wizards on button print return ir.actrions.report with key close_on_report_download = True

can you add this functionality to your module?

Re: don't close wizars window
by
Ivan Sokolov
on 5/3/24, 6:46 AM Author

Hi Oleg, thank you for the feedback! 

Will check and add it if this will not break the code.



by
Trinh Duc Cuong
on 11/9/23, 11:59 AM

500: Internal Server Error

Traceback (most recent call last):
  File "/opt/odoo/odoo/tools/safe_eval.py", line 212, in test_expr
    expr = expr.strip()
AttributeError: 'bool' object has no attribute 'strip'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/odoo/odoo/http.py", line 1584, in _serve_db
    return service_model.retrying(self._serve_ir_http, self.env)
  File "/opt/odoo/odoo/service/model.py", line 133, in retrying
    result = func()
  File "/opt/odoo/odoo/http.py", line 1611, in _serve_ir_http
    response = self.dispatcher.dispatch(rule.endpoint, args)
  File "/opt/odoo/odoo/http.py", line 1725, in dispatch
    return self.request.registry['ir.http']._dispatch(endpoint)
  File "/opt/odoo/addons/website/models/ir_http.py", line 235, in _dispatch
    response = super()._dispatch(endpoint)
  File "/opt/odoo/odoo/addons/base/models/ir_http.py", line 154, in _dispatch
    result = endpoint(**request.params)
  File "/opt/odoo/odoo/http.py", line 697, in route_wrapper
    result = endpoint(self, *args, **params_ok)
  File "/opt/odoo/community/prt_report_attachment_preview/controllers/report.py", line 108, in report_routes
    report_file_name = self._compose_report_file_name(docids, report)
  File "/opt/odoo/community/prt_report_attachment_preview/controllers/report.py", line 50, in _compose_report_file_name
    report_name = safe_eval(
  File "/opt/odoo/odoo/tools/safe_eval.py", line 360, in safe_eval
    c = test_expr(expr, _SAFE_OPCODES, mode=mode, filename=filename)
  File "/opt/odoo/odoo/tools/safe_eval.py", line 217, in test_expr
    raise ValueError('"%s" while compiling\n%r' % (ustr(e), expr))
ValueError: "'bool' object has no attribute 'strip'" while compiling
False

I have this error on every report.

Re:
by
Ivan Sokolov
on 11/9/23, 1:21 PM Author

Hi and thank you for your feedback! 
Could you please provide some more information so we could reproduce this issue and do a fix:
- Odoo version
- User language/document language
- Module version. Should be 16.0.1.0.3
- Custom addons from the Odoo App Store installed (if any)

Please send your report to support AT cetmix DOT com


Simple and functional
by
Ramon Valladarez
on 10/11/23, 2:02 PM

a plugin that does what it says, without configuration it is installed and that's it. thanks to the develope


by
Luis Grijalva
on 9/29/23, 2:16 PM

Error on printing labels is now fixed thanks thanks Ivan!, quick and great response!

Luis G



There is security restrict issue for multi company environment orders
by
Mark Ding
on 3/6/23, 5:26 AM

There is security restrict issue for multi company environment orders. Could you fix that? Thank you.

Re: There is security restrict issue for multi company environment orders
by
Ivan Sokolov
on 3/6/23, 6:48 AM Author

Could you please provide detailed report to support @. cetmix DOT com ?


Again problems when product has serial number
by
Luis Grijalva
on 8/31/24, 7:12 PM

Hello, though this issue was fixed, but appear again, I am using last add-on version for Odoo16

this is the log error text:

500: Internal Server Error

Alternativa a la plantilla

Se produjo un error al renderizar la plantilla stock.stock_report_delivery_has_serial_move_line.

Si este error es causado por un cambio suyo en las plantillas, tiene la posibilidad de restablecer la plantilla a su configuración de fábrica.

  • report_delivery_has_serial_move_line_description

 

QWeb

Mensaje de error:

Error while render the template
KeyError: 'name'
Template: stock.stock_report_delivery_has_serial_move_line
Path: /t/td[2]/span
Node: 

El error ocurrió durante la creación de la plantilla stock.stock_report_delivery_has_serial_move_line y evalua la siguiente expresión: 

Traza

Traceback (most recent call last):
  File "", line 280, in template_967
  File "", line 84, in template_967_content
  File "/odoo16/odoo16-server/odoo/addons/base/models/ir_qweb.py", line 2364, in _get_field
    field = record._fields[field_name]
KeyError: 'name'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/odoo16/odoo16-server/odoo/http.py", line 1591, in _serve_db
    return service_model.retrying(self._serve_ir_http, self.env)
  File "/odoo16/odoo16-server/odoo/service/model.py", line 133, in retrying
    result = func()
  File "/odoo16/odoo16-server/odoo/http.py", line 1618, in _serve_ir_http
    response = self.dispatcher.dispatch(rule.endpoint, args)
  File "/odoo16/odoo16-server/odoo/http.py", line 1732, in dispatch
    return self.request.registry['ir.http']._dispatch(endpoint)
  File "/odoo16/odoo16-server/addons/website/models/ir_http.py", line 237, in _dispatch
    response = super()._dispatch(endpoint)
  File "/odoo16/odoo16-server/odoo/addons/base/models/ir_http.py", line 154, in _dispatch
    result = endpoint(**request.params)
  File "/odoo16/odoo16-server/odoo/http.py", line 697, in route_wrapper
    result = endpoint(self, *args, **params_ok)
  File "/odoo16/custom/misc/prt_report_attachment_preview/controllers/report.py", line 157, in report_routes
    pdf = report_obj.with_context(**context)._render_qweb_pdf(
  File "/odoo16/odoo16-server/addons/account/models/ir_actions_report.py", line 61, in _render_qweb_pdf
    return super()._render_qweb_pdf(report_ref, res_ids=res_ids, data=data)
  File "/odoo16/odoo16-server/odoo/addons/base/models/ir_actions_report.py", line 820, in _render_qweb_pdf
    collected_streams = self._render_qweb_pdf_prepare_streams(report_ref, data, res_ids=res_ids)
  File "/odoo16/odoo16-server/addons/account_edi_ubl_cii/models/ir_actions_report.py", line 58, in _render_qweb_pdf_prepare_streams
    collected_streams = super()._render_qweb_pdf_prepare_streams(report_ref, data, res_ids=res_ids)
  File "/odoo16/odoo16-server/addons/account_edi/models/ir_actions_report.py", line 14, in _render_qweb_pdf_prepare_streams
    collected_streams = super()._render_qweb_pdf_prepare_streams(report_ref, data, res_ids=res_ids)
  File "/odoo16/odoo16-server/addons/account/models/ir_actions_report.py", line 20, in _render_qweb_pdf_prepare_streams
    return super()._render_qweb_pdf_prepare_streams(report_ref, data, res_ids=res_ids)
  File "/odoo16/odoo16-server/odoo/addons/base/models/ir_actions_report.py", line 709, in _render_qweb_pdf_prepare_streams
    html = self.with_context(**additional_context)._render_qweb_html(report_ref, res_ids_wo_stream, data=data)[0]
  File "/odoo16/odoo16-server/odoo/addons/base/models/ir_actions_report.py", line 897, in _render_qweb_html
    return self._render_template(report.report_name, data), 'html'
  File "/odoo16/odoo16-server/odoo/addons/base/models/ir_actions_report.py", line 624, in _render_template
    return view_obj._render_template(template, values).encode()
  File "/odoo16/odoo16-server/addons/website/models/ir_ui_view.py", line 419, in _render_template
    return super()._render_template(template, values=values)
  File "/odoo16/odoo16-server/odoo/addons/base/models/ir_ui_view.py", line 2127, in _render_template
    return self.env['ir.qweb']._render(template, values)
  File "/odoo16/odoo16-server/odoo/tools/profiler.py", line 292, in _tracked_method_render
    return method_render(self, template, values, **options)
  File "/odoo16/odoo16-server/odoo/addons/base/models/ir_qweb.py", line 581, in _render
    result = ''.join(rendering)
  File "", line 65, in template_971
  File "", line 52, in template_971_content
  File "", line 1768, in template_966
  File "", line 1750, in template_966_content
  File "", line 1733, in template_966_t_call_0
  File "", line 1412, in template_966_t_call_1
  File "", line 286, in template_967
odoo.addons.base.models.ir_qweb.QWebException: Error while render the template
KeyError: 'name'
Template: stock.stock_report_delivery_has_serial_move_line
Path: /t/td[2]/span
Node: 





Re: Again problems when product has serial number
by
Ivan Sokolov
on 9/1/24, 4:35 AM Author

Hello, thank you for the feedback! According to the log there is an error in your template. Could you please uninstall the module and check if the error persists?


by
mike chen
on 3/21/24, 8:26 PM

Hello, sir. Is there an update for the default Odoo URL too long?

Re:
by
Ivan Sokolov
on 3/22/24, 4:17 AM Author

Hello, not yet.


Amazing modules
by
mike chen
on 3/7/24, 1:08 AM

Great modules. However, when I tried to view my 10.000 products report, it goes to about:blank#blocked
Is it because of the products that I have too much? Can it be fixed, please?

Re: Amazing modules
by
Ivan Sokolov
on 3/7/24, 3:38 AM Author

Hi Mike, thank you for your feedback!

This is pr because default URL generated by Odoo  is too long. Let me check this.


by
阿灿
on 1/30/24, 3:18 AM

Hello, has the problem been fixed?

Re:
by
Ivan Sokolov
on 1/30/24, 5:41 AM Author

Hello, yes. Please download the latest version and try again. 
Send your feedback on support AT cetmix DOT com if you have any further issues.


by
阿灿
on 1/14/24, 8:54 AM

The language I used was Chinese, and then I found that after switching to English, the report was fine. Every report is the same.

Re:
by
Ivan Sokolov
on 1/14/24, 10:31 AM Author

Thank you for the feedback! We will check this.


by
阿灿
on 1/12/24, 11:38 PM

2024-01-13 04:14:56,895 11020 ERROR Test-Data werkzeug: Error on request:
Traceback (most recent call last):
  File "/opt/odoo/odoo-server/odoovenv/lib/python3.10/site-packages/werkzeug/serving.py", line 319, in run_wsgi
    execute(self.server.app)
  File "/opt/odoo/odoo-server/odoovenv/lib/python3.10/site-packages/werkzeug/serving.py", line 311, in execute
    write(data)
  File "/opt/odoo/odoo-server/odoovenv/lib/python3.10/site-packages/werkzeug/serving.py", line 272, in write
    self.send_header(key, value)
  File "/opt/odoo/odoo-server/odoo/service/server.py", line 149, in send_header
    super().send_header(keyword, value)
  File "/usr/lib/python3.10/http/server.py", line 523, in send_header
    ("%s: %s\r\n" % (keyword, value)).encode('latin-1', 'strict'))
UnicodeEncodeError: 'latin-1' codec can't encode characters in position 39-44: ordinal not in range(256)

Re:
by
Ivan Sokolov
on 1/14/24, 8:06 AM Author

Hi, thank you for the feedback!

1. Which language are you using?
2. Which report are you trying to print?


by
阿灿
on 1/12/24, 10:54 PM

500: Internal Server Error

Odoo 16.0-20240104

 and your module version is 16.0.1.0.5



by
阿灿
on 1/12/24, 10:52 PM



New release
by
Ivan Sokolov
on 1/8/24, 11:51 AM Author

500: Internal Server Error

This is fixed. Please download the latest version


500: Internal Server Error
by
Ted
on 12/20/23, 12:57 PM

Same error as Trinh Duc Cuong. What was the fix for this?

Thank you

Re: 500: Internal Server Error
by
Ivan Sokolov
on 1/8/24, 11:52 AM Author

This is fixed. Please download the latest version


by
mike chen
on 12/19/23, 11:03 AM

Hello, sir. Is the problem already solved?

Re:
by
Ivan Sokolov
on 12/19/23, 4:22 PM Author

Hi Mike, in progress. Planning to fix until the end of this year. Will make a public announcement when done.

Re:
by
Ivan Sokolov
on 12/19/23, 4:22 PM Author

Hi Mike, in progress. Planning to fix until the end of this year. Will make a public announcement when done.


by
mike chen
on 12/16/23, 11:12 PM

It's standard, sir. I haven't done any customization

Re:
by
Ivan Sokolov
on 12/17/23, 4:36 AM Author

Thank you, we will check it today


by
mike chen
on 12/15/23, 11:56 AM

Hello, I got this error when I try to print Payment Receipt
I use Odoo 16 CE and your module version is 16.0.1.0.3


500: Internal Server Error

Traceback

Traceback (most recent call last):
  File "/limomoli/limomoli-server/odoo/tools/safe_eval.py", line 212, in test_expr
    expr = expr.strip()
AttributeError: 'bool' object has no attribute 'strip'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/limomoli/limomoli-server/odoo/http.py", line 1589, in _serve_db
    return service_model.retrying(self._serve_ir_http, self.env)
  File "/limomoli/limomoli-server/odoo/service/model.py", line 133, in retrying
    result = func()
  File "/limomoli/limomoli-server/odoo/http.py", line 1616, in _serve_ir_http
    response = self.dispatcher.dispatch(rule.endpoint, args)
  File "/limomoli/limomoli-server/odoo/http.py", line 1730, in dispatch
    return self.request.registry['ir.http']._dispatch(endpoint)
  File "/limomoli/limomoli-server/odoo/addons/base/models/ir_http.py", line 154, in _dispatch
    result = endpoint(**request.params)
  File "/limomoli/limomoli-server/odoo/http.py", line 697, in route_wrapper
    result = endpoint(self, *args, **params_ok)
  File "/limomoli/custom/addons/prt_report_attachment_preview/controllers/report.py", line 108, in report_routes
    report_file_name = self._compose_report_file_name(docids, report)
  File "/limomoli/custom/addons/prt_report_attachment_preview/controllers/report.py", line 50, in _compose_report_file_name
    report_name = safe_eval(
  File "/limomoli/limomoli-server/odoo/tools/safe_eval.py", line 360, in safe_eval
    c = test_expr(expr, _SAFE_OPCODES, mode=mode, filename=filename)
  File "/limomoli/limomoli-server/odoo/tools/safe_eval.py", line 217, in test_expr
    raise ValueError('"%s" while compiling\n%r' % (ustr(e), expr))
ValueError: "'bool' object has no attribute 'strip'" while compiling
False




Re:
by
Ivan Sokolov
on 12/15/23, 12:34 PM Author

Hi Mike, thank you for your feedback. Is this an absolutely standard auto or do you have any customization done to it?


by
LongSences
on 11/30/23, 8:50 PM

At present, we have a problem, using the 16 version, after printing only a line of text "HTTP/1.0 200 OK", can help to answer it? Thank you very much!

Re:
by
Ivan Sokolov
on 12/1/23, 4:05 AM Author

HI LongSences,

Please check comments below. We need to know which report exactly gives you that error. Please share the information at support AT cetmix DOT com
To fix a bug we need to understand where the issue happens. 
We are testing the module on the vanilla Odoo CE and EE editions and cannot predict all the possible custom module behaviour.

Re:
by
Ivan Sokolov
on 12/1/23, 4:05 AM Author

HI LongSences,

Please check comments below. We need to know which report exactly gives you that error. Please share the information at support AT cetmix DOT com
To fix a bug we need to understand where the issue happens. 
We are testing the module on the vanilla Odoo CE and EE editions and cannot predict all the possible custom module behaviour.


by
mike chen
on 11/27/23, 5:48 AM

It happens when I try to open my custom module report

Re:
by
Ivan Sokolov
on 11/27/23, 6:48 AM Author

Hi Mike, we are testing our modules using official Odoo CE and EE images.
It's technically not possible to ensure that it will work with any custom module.

However we can check the issue if you share that module code with us. Please send us a note to support AT cetmix DOT com


by
Amgad Nabil
on 11/26/23, 2:38 PM

500: Internal Server Error

Traceback

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/odoo/http.py", line 1584, in _serve_db
    return service_model.retrying(self._serve_ir_http, self.env)
  File "/usr/lib/python3/dist-packages/odoo/service/model.py", line 133, in retrying
    result = func()
  File "/usr/lib/python3/dist-packages/odoo/http.py", line 1611, in _serve_ir_http
    response = self.dispatcher.dispatch(rule.endpoint, args)
  File "/usr/lib/python3/dist-packages/odoo/http.py", line 1725, in dispatch
    return self.request.registry['ir.http']._dispatch(endpoint)
  File "/usr/lib/python3/dist-packages/odoo/addons/base/models/ir_http.py", line 154, in _dispatch
    result = endpoint(**request.params)
  File "/usr/lib/python3/dist-packages/odoo/http.py", line 697, in route_wrapper
    result = endpoint(self, *args, **params_ok)
  File "/usr/Custom/Addons/prt_report_attachment_preview/controllers/report.py", line 74, in report_routes
    data.update(json.loads(data.pop("options")))
  File "/usr/lib/python3.8/json/__init__.py", line 357, in loads
    return _default_decoder.decode(s)
  File "/usr/lib/python3.8/json/decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/lib/python3.8/json/decoder.py", line 355, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)




there is raised error when i'm trying to print product labels


Re:
by
Ivan Sokolov
on 11/26/23, 5:05 PM Author

Hello Amgad, thank you for your feedback!

Could you please send a copy of the error to support AT cetmix DOT com.

Also please include the info regarding which language is configure in the user settings and if there are any custom reports installed. Eg accounting or financial reporting.


by
mike chen
on 11/24/23, 7:41 AM

500: Internal Server Error

Traceback

Traceback (most recent call last):
  File "D:\odoo\server\odoo\tools\safe_eval.py", line 212, in test_expr
    expr = expr.strip()
AttributeError: 'bool' object has no attribute 'strip'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "D:\odoo\server\odoo\http.py", line 1589, in _serve_db
    return service_model.retrying(self._serve_ir_http, self.env)
  File "D:\odoo\server\odoo\service\model.py", line 133, in retrying
    result = func()
  File "D:\odoo\server\odoo\http.py", line 1616, in _serve_ir_http
    response = self.dispatcher.dispatch(rule.endpoint, args)
  File "D:\odoo\server\odoo\http.py", line 1730, in dispatch
    return self.request.registry['ir.http']._dispatch(endpoint)
  File "D:\odoo\server\odoo\addons\base\models\ir_http.py", line 154, in _dispatch
    result = endpoint(**request.params)
  File "D:\odoo\server\odoo\http.py", line 697, in route_wrapper
    result = endpoint(self, *args, **params_ok)
  File "D:\odoo\server\odoo\addons\prt_report_attachment_preview\controllers\report.py", line 108, in report_routes
    report_file_name = self._compose_report_file_name(docids, report)
  File "D:\odoo\server\odoo\addons\prt_report_attachment_preview\controllers\report.py", line 50, in _compose_report_file_name
    report_name = safe_eval(
  File "D:\odoo\server\odoo\tools\safe_eval.py", line 360, in safe_eval
    c = test_expr(expr, _SAFE_OPCODES, mode=mode, filename=filename)
  File "D:\odoo\server\odoo\tools\safe_eval.py", line 217, in test_expr
    raise ValueError('"%s" while compiling\n%r' % (ustr(e), expr))
ValueError: "'bool' object has no attribute 'strip'" while compiling
False
Hello, I'm using Odoo 16 and your module version is 16.0.1.0.3




Re:
by
Ivan Sokolov
on 11/24/23, 8:27 AM Author

Hello Mike, thank you for your feedback! We are already working on the solution for this issue.
Could you please specify which reports exactly trigger this error?
Please submit the information to support AT cetmix DOT com 


Misunderstanding of the error
by
Leon Jiang
on 11/12/23, 8:12 AM

My previously comment may take you misunderstanding, my error is same as Trinh Duc Cuong in Rating comment, it is a bool & strip error cause by this app doing the name change accrue the other apps generate the PDF report to meet this error.

Traceback (most recent call last):
  File "/opt/odoo/odoo/tools/safe_eval.py", line 212, in test_expr
    expr = expr.strip()
AttributeError: 'bool' object has no attribute 'strip'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "/opt/odoo/odoo/http.py", line 1584, in _serve_db
    return service_model.retrying(self._serve_ir_http, self.env)
  File "/opt/odoo/odoo/service/model.py", line 133, in retrying
    result = func()
  File "/opt/odoo/odoo/http.py", line 1611, in _serve_ir_http
    response = self.dispatcher.dispatch(rule.endpoint, args)
  File "/opt/odoo/odoo/http.py", line 1725, in dispatch
    return self.request.registry['ir.http']._dispatch(endpoint)
  File "/opt/odoo/addons/website/models/ir_http.py", line 235, in _dispatch
    response = super()._dispatch(endpoint)
  File "/opt/odoo/odoo/addons/base/models/ir_http.py", line 154, in _dispatch
    result = endpoint(**request.params)
  File "/opt/odoo/odoo/http.py", line 697, in route_wrapper
    result = endpoint(self, *args, **params_ok)
  File "/opt/odoo/community/prt_report_attachment_preview/controllers/report.py", line 108, in report_routes
    report_file_name = self._compose_report_file_name(docids, report)
  File "/opt/odoo/community/prt_report_attachment_preview/controllers/report.py", line 50, in _compose_report_file_name
    report_name = safe_eval(
  File "/opt/odoo/odoo/tools/safe_eval.py", line 360, in safe_eval
    c = test_expr(expr, _SAFE_OPCODES, mode=mode, filename=filename)
  File "/opt/odoo/odoo/tools/safe_eval.py", line 217, in test_expr
    raise ValueError('"%s" while compiling\n%r' % (ustr(e), expr))
ValueError: "'bool' object has no attribute 'strip'" while compiling
False



Re: Misunderstanding of the error
by
Ivan Sokolov
on 11/12/23, 9:26 AM Author

Noted! Thank you for clarification!


500: Internal Server Error
by
Leon Jiang
on 11/12/23, 6:38 AM

I have got the same error as Mike Chen, I found that the issue is this APP will change the file name that affect some other third party apps work meet this error.  Such as the customer statement from browseinfo and softhealer.

could you please fix that naming issues for a new update?  Really like this App.

My odoo version is 

Odoo 16.0+e-20230925 (Enterprise Edition)


With the App version is 

prt_report_attachment_preview-16.0.1.0.3

Re: 500: Internal Server Error
by
Ivan Sokolov
on 11/12/23, 7:38 AM Author

Hi Leon, thank you for the feedback!

We are working on the fix already. 


by
mike chen
on 9/24/23, 12:18 PM

im trying to print all accounting report like profit and loss, general ledger, balance sheet, etc. My accounting module is from Odoo Mates

Re:
by
Ivan Sokolov
on 9/27/23, 6:39 AM Author

Hi Mike, please download the latest version and try again.

Product label printing should work too


by
mike chen
on 9/24/23, 10:16 AM

500: Internal Server Error

Traceback (most recent call last):
  File "C:\Program Files\Odoo 16.0.20230924\server\odoo\http.py", line 1584, in _serve_db
    return service_model.retrying(self._serve_ir_http, self.env)
  File "C:\Program Files\Odoo 16.0.20230924\server\odoo\service\model.py", line 133, in retrying
    result = func()
  File "C:\Program Files\Odoo 16.0.20230924\server\odoo\http.py", line 1611, in _serve_ir_http
    response = self.dispatcher.dispatch(rule.endpoint, args)
  File "C:\Program Files\Odoo 16.0.20230924\server\odoo\http.py", line 1725, in dispatch
    return self.request.registry['ir.http']._dispatch(endpoint)
  File "C:\Program Files\Odoo 16.0.20230924\server\odoo\addons\base\models\ir_http.py", line 154, in _dispatch
    result = endpoint(**request.params)
  File "C:\Program Files\Odoo 16.0.20230924\server\odoo\http.py", line 697, in route_wrapper
    result = endpoint(self, *args, **params_ok)
  File "C:\Program Files\Odoo 16.0.20230924\server\odoo\addons\prt_report_attachment_preview\controllers\report.py", line 74, in report_routes
    data.update(json.loads(data.pop("options")))
  File "C:\Program Files\Odoo 16.0.20230924\python\lib\json\__init__.py", line 346, in loads
    return _default_decoder.decode(s)
  File "C:\Program Files\Odoo 16.0.20230924\python\lib\json\decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "C:\Program Files\Odoo 16.0.20230924\python\lib\json\decoder.py", line 355, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
My version is  16.0.1.0.1

And I installed accounting module from Odoo mates. When Im generate report from accounting, it shows this error
Re:
by
Ivan Sokolov
on 9/24/23, 11:33 AM Author

Hello,

Thank you for the feedback! What for a module is that? And which report exactly you are printing?


by
Luis Grijalva
on 9/19/23, 7:35 PM

In odoo 16 got this error printing labels:

500: Internal Server Error

Rastrear

Traceback (most recent call last): File "/odoo16/odoo16-server/odoo/http.py", line 1583, in _serve_db return service_model.retrying(self._serve_ir_http, self.env) File "/odoo16/odoo16-server/odoo/service/model.py", line 134, in retrying result = func() File "/odoo16/odoo16-server/odoo/http.py", line 1610, in _serve_ir_http response = self.dispatcher.dispatch(rule.endpoint, args) File "/odoo16/odoo16-server/odoo/http.py", line 1723, in dispatch return self.request.registry['ir.http']._dispatch(endpoint) File "/odoo16/odoo16-server/addons/website/models/ir_http.py", line 235, in _dispatch response = super()._dispatch(endpoint) File "/odoo16/odoo16-server/odoo/addons/base/models/ir_http.py", line 154, in _dispatch result = endpoint(**request.params) File "/odoo16/odoo16-server/odoo/http.py", line 696, in route_wrapper result = endpoint(self, *args, **params_ok) File "/odoo16/custom/misc/prt_report_attachment_preview/controllers/report.py", line 74, in report_routes data.update(json.loads(data.pop("options"))) File "/usr/lib/python3.10/json/__init__.py", line 346, in loads return _default_decoder.decode(s) File "/usr/lib/python3.10/json/decoder.py", line 337, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) File "/usr/lib/python3.10/json/decoder.py", line 355, in raw_decode raise JSONDecodeError("Expecting value", s, err.value) from None json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)


Uninstalling and restarting the server fix this and can print labels again


Luis G

Re:
by
Ivan Sokolov
on 9/20/23, 3:35 AM Author

Hi and than you for reporting. Which module version are you using? Eg "16.0.1.0.1"


Multi Company Issue
by
Abakada
on 9/12/23, 11:07 PM

Multi-Company issue

Please check the error on my screenshot for the multi-company issue when printing 

Re: Multi Company Issue
by
Ivan Sokolov
on 9/13/23, 8:05 AM Author

Hi, thank you for the feedback! Could you please update the module to the latest version and test again? 
Should be version 16.0.1.0.1