This question has been flagged
4 Replies
4273 Views

I am using a third-party module in Odoo to do mass label printing ([https://www.odoo.com/apps/modules/12.0/label/][1]) and despite that the fact that the module claims to be compatible with version 12, I am getting server errors when trying to run the pdf rendering:

Odoo Server Error
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/odoo/addons/web/controllers/main.py", line 1677, in report_download
response = self.report_routes(reportname, converter=converter, **dict(data))
File "/usr/lib/python3/dist-packages/odoo/http.py", line 517, in response_wrap
response = f(*args, **kw)
File "/usr/lib/python3/dist-packages/odoo/addons/web/controllers/main.py", line 1614, in report_routes
pdf = report.with_context(context).render_qweb_pdf(docids, data=data)[0]
File "/usr/lib/python3/dist-packages/odoo/addons/base/models/ir_actions_report.py", line 677, in render_qweb_pdf
html = self.with_context(context).render_qweb_html(res_ids, data=data)[0]
File "/usr/lib/python3/dist-packages/odoo/addons/base/models/ir_actions_report.py", line 710, in render_qweb_html
data = self._get_rendering_context(docids, data)
File "/usr/lib/python3/dist-packages/odoo/addons/base/models/ir_actions_report.py", line 723, in _get_rendering_context
data.update(report_model._get_report_values(docids, data=data))
AttributeError: 'report.label.report_label' object has no attribute '_get_report_values'

Screenshot:

![Odoo](https://i.imgur.com/FGCxLwb.png)


It may be an error related to the change of some Odoo version (or not, I don’t really know).


Does anyone know if this attribute exist? I haven’t been able to find this information in the Odoo documentation (it doesn’t seem very complete regarding these topic).


Here are some screenshots of the configurations I’m using:

https://i.imgur.com/xITBy7B.png

https://i.imgur.com/MyqQOAl.png

https://i.imgur.com/OkmZKLv.png

https://i.imgur.com/zaXUddm.png


Thank you for your help!

Avatar
Discard
Best Answer

Hello,

In module go to report > dynamic_label.py file and change method name from get_report_values to _get_report_values.

Thanks

Avatar
Discard
Author

Thank you for this workaround! The pdf generation is now working. By the way, now the generated pdf is blank (empty page), with 0 bytes. Am I missing something? It could be that my configuration is wrong. Do you have any working example? Thank you so much.

Hi cristian,

Please check your configuration for label printing, I have tasted for product label printing (product.template) and it looks like it works.

You can get an example from modules description (index file) from the app store and follow it to test working or not.

Best Answer

Hello Cristian González,

For Empty pdf problem, try to set the Label Configuration by go to [ Settings >> Configuration >> Label Configuration >> Create ]

On the setting, Need to put the both of values for Height (in mm) and Width (in mm).

https://sv1.picz.in.th/images/2019/01/30/T96UO0.png


Avatar
Discard