TheCloneMaster / product_barcode_qweb

Quick and dirty module to print barcode labels for products on Odoo. should be used as a basic model to adapt to your needs
4 stars 6 forks source link

Permissions error #2

Open Whytehorse opened 8 years ago

Whytehorse commented 8 years ago

What permissions need to be set to make this module work? I get the following permissions error when using this module in odoo 8

Odoo Server Error

Traceback (most recent call last): File "/usr/lib/python2.7/dist-packages/openerp/addons/report/controllers/main.py", line 125, in report_download response = self.report_routes(reportname, converter='pdf', _dict(data)) File "/usr/lib/python2.7/dist-packages/openerp/http.py", line 403, in response_wrap response = f(_args, _kw) File "/usr/lib/python2.7/dist-packages/openerp/addons/report_custom_filename/controllers/report_controller.py", line 34, in report_routes reportname, docids=docids, converter=converter, _data) File "/usr/lib/python2.7/dist-packages/openerp/http.py", line 403, in response_wrap response = f(_args, _kw) File "/usr/lib/python2.7/dist-packages/openerp/addons/report/controllers/main.py", line 65, in report_routes pdf = report_obj.get_pdf(cr, uid, docids, reportname, data=options_data, context=context) File "/usr/lib/python2.7/dist-packages/openerp/api.py", line 250, in wrapper return old_api(self, _args, _kwargs) File "/usr/lib/python2.7/dist-packages/openerp/addons/report/models/report.py", line 191, in get_pdf html = self.get_html(cr, uid, ids, report_name, data=data, context=context) File "/usr/lib/python2.7/dist-packages/openerp/api.py", line 250, in wrapper return old_api(self, _args, _kwargs) File "/usr/lib/python2.7/dist-packages/openerp/addons/report/models/report.py", line 166, in get_html return particularreport_obj.render_html(cr, uid, ids, data=data, context=context) File "/usr/lib/python2.7/dist-packages/openerp/api.py", line 250, in wrapper return old_api(self, _args, _kwargs) File "/usr/lib/python2.7/dist-packages/openerp/addons/report/models/abstract_report.py", line 66, in render_html return self.pool['report'].render(cr, uid, [], self._template, docargs, context=context) File "/usr/lib/python2.7/dist-packages/openerp/api.py", line 250, in wrapper return old_api(self, _args, _kwargs) File "/usr/lib/python2.7/dist-packages/openerp/addons/website_report/report.py", line 47, in render return super(Report, self).render(cr, uid, ids, template, values=values, context=context) File "/usr/lib/python2.7/dist-packages/openerp/api.py", line 250, in wrapper return old_api(self, _args, _kwargs) File "/usr/lib/python2.7/dist-packages/openerp/addons/report/models/report.py", line 152, in render return view_obj.render(cr, uid, template, values, context=context) File "/usr/lib/python2.7/dist-packages/openerp/api.py", line 250, in wrapper return old_api(self, _args, _kwargs) File "/usr/lib/python2.7/dist-packages/openerp/addons/website/models/ir_ui_view.py", line 172, in render return super(view, self).render(cr, uid, id_or_xml_id, values=values, engine=engine, context=context) File "/usr/lib/python2.7/dist-packages/openerp/api.py", line 250, in wrapper return old_api(self, _args, _kwargs) File "/usr/lib/python2.7/dist-packages/openerp/addons/base/ir/ir_ui_view.py", line 1017, in render return self.pool[engine].render(cr, uid, id_or_xml_id, qcontext, loader=loader, context=context) File "/usr/lib/python2.7/dist-packages/openerp/api.py", line 250, in wrapper return old_api(self, _args, _kwargs) File "/usr/lib/python2.7/dist-packages/openerp/addons/base/ir/ir_qweb.py", line 263, in render return self.render_node(self.get_template(id_or_xml_id, qwebcontext), qwebcontext) File "/usr/lib/python2.7/dist-packages/openerp/addons/base/ir/ir_qweb.py", line 302, in render_node result = self.render_element(element, template_attributes, generated_attributes, qwebcontext) File "/usr/lib/python2.7/dist-packages/openerp/addons/base/ir/ir_qweb.py", line 323, in render_element g_inner.append(self.render_node(current_node, qwebcontext)) File "/usr/lib/python2.7/dist-packages/openerp/addons/base/ir/ir_qweb.py", line 302, in render_node result = self.render_element(element, template_attributes, generated_attributes, qwebcontext) File "/usr/lib/python2.7/dist-packages/openerp/addons/base/ir/ir_qweb.py", line 323, in render_element g_inner.append(self.render_node(current_node, qwebcontext)) File "/usr/lib/python2.7/dist-packages/openerp/addons/base/ir/ir_qweb.py", line 302, in render_node result = self.render_element(element, template_attributes, generated_attributes, qwebcontext) File "/usr/lib/python2.7/dist-packages/openerp/addons/base/ir/ir_qweb.py", line 323, in render_element g_inner.append(self.render_node(current_node, qwebcontext)) File "/usr/lib/python2.7/dist-packages/openerp/addons/base/ir/ir_qweb.py", line 302, in render_node result = self.render_element(element, template_attributes, generated_attributes, qwebcontext) File "/usr/lib/python2.7/dist-packages/openerp/addons/base/ir/ir_qweb.py", line 323, in render_element g_inner.append(self.render_node(current_node, qwebcontext)) File "/usr/lib/python2.7/dist-packages/openerp/addons/base/ir/ir_qweb.py", line 300, in render_node result = self._render_tag[t_render](self, element, template_attributes, generated_attributes, qwebcontext) File "/usr/lib/python2.7/dist-packages/openerp/addons/base/ir/ir_qweb.py", line 424, in render_tag_foreach ru.append(self.render_element(element, template_attributes, generated_attributes, copy_qwebcontext)) File "/usr/lib/python2.7/dist-packages/openerp/addons/base/ir/ir_qweb.py", line 323, in render_element g_inner.append(self.render_node(current_node, qwebcontext)) File "/usr/lib/python2.7/dist-packages/openerp/addons/base/ir/ir_qweb.py", line 300, in render_node result = self._render_tag[t_render](self, element, template_attributes, generated_attributes, qwebcontext) File "/usr/lib/python2.7/dist-packages/openerp/addons/base/ir/ir_qweb.py", line 424, in render_tag_foreach ru.append(self.render_element(element, template_attributes, generated_attributes, copy_qwebcontext)) File "/usr/lib/python2.7/dist-packages/openerp/addons/base/ir/ir_qweb.py", line 323, in render_element g_inner.append(self.render_node(current_node, qwebcontext)) File "/usr/lib/python2.7/dist-packages/openerp/addons/base/ir/ir_qweb.py", line 302, in render_node result = self.render_element(element, template_attributes, generated_attributes, qwebcontext) File "/usr/lib/python2.7/dist-packages/openerp/addons/base/ir/ir_qweb.py", line 323, in render_element g_inner.append(self.render_node(current_node, qwebcontext)) File "/usr/lib/python2.7/dist-packages/openerp/addons/base/ir/ir_qweb.py", line 284, in render_node self, element, attribute_name, attribute_value, qwebcontext) File "/usr/lib/python2.7/dist-packages/openerp/addons/base/ir/ir_qweb.py", line 359, in render_att_att return [(attribute_name[6:], self.eval(attribute_value, qwebcontext))] File "/usr/lib/python2.7/dist-packages/openerp/addons/base/ir/ir_qweb.py", line 207, in eval raise_qweb_exception(message="Could not evaluate expression %r" % expr, expression=expr, template=template) File "/usr/lib/python2.7/dist-packages/openerp/addons/base/ir/ir_qweb.py", line 204, in eval return qwebcontext.safe_eval(expr) File "/usr/lib/python2.7/dist-packages/openerp/addons/base/ir/ir_qweb.py", line 89, in safe_eval return eval(expr, None, locals_dict, nocopy=True, locals_builtins=True) File "/usr/lib/python2.7/dist-packages/openerp/tools/safe_eval.py", line 314, in safe_eval return eval(c, globals_dict, locals_dict) File "", line 1, in File "/usr/lib/python2.7/dist-packages/openerp/addons/product_barcode_qweb/report/product_barcode_print.py", line 73, in _generateBarcode Code128().getImage(barcode_string, path="./").save(fp,"PNG") File "/usr/lib/python2.7/dist-packages/openerp/addons/product_barcode_qweb/report/Code128.py", line 233, in getImage decodeFontFile(courB08_pil ,path+"courB08.pil") File "/usr/lib/python2.7/dist-packages/openerp/addons/product_barcode_qweb/report/Code128.py", line 274, in decodeFontFile open (file, "wb").write(decompress(decodestring(data))) QWebException: "13 Permission denied" while evaluating "'data:image/png;base64,'+generateBarcode(label_data['default_code'])"

TheCloneMaster commented 8 years ago

Hi,

Check the value of variable "file" right before the "open", then give permissions to container folder

In my server it was /tmp

Regards, -Mario

On Fri, Feb 12, 2016 at 8:29 PM, Whytehorse notifications@github.com wrote:

What permissions need to be set to make this module work? I get the following permissions error when using this module in odoo 8

Odoo Server Error

Traceback (most recent call last): File "/usr/lib/python2.7/dist-packages/openerp/addons/report/controllers/main.py", line 125, in report_download response = self.report_routes(reportname, converter='pdf', *

_dict(data)) File "/usr/lib/python2.7/dist-packages/openerp/http.py", line 403, in response_wrap response = f(_args, *

_kw) File "/usr/lib/python2.7/dist-packages/openerp/addons/report_custom_filename/controllers/report_controller.py", line 34, in reportroutes reportname, docids=docids, converter=converter, * data) File "/usr/lib/python2.7/dist-packages/openerp/http.py", line 403, in response_wrap response = f(_args, _kw) File "/usr/lib/python2.7/dist-packages/openerp/addons/report/controllers/main.py", line 65, in report_routes pdf = report_obj.get_pdf(cr, uid, docids, reportname, data=options_data, context=context) File "/usr/lib/python2.7/dist-packages/openerp/api.py", line 250, in wrapper return old_api(self, _args, _kwargs) File "/usr/lib/python2.7/dist-packages/openerp/addons/report/models/report.py", line 191, in get_pdf html = self.get_html(cr, uid, ids, report_name, data=data, context=context) File "/usr/lib/python2.7/dist-packages/openerp/api.py", line 250, in wrapper return old_api(self, _args, _kwargs) File "/usr/lib/python2.7/dist-packages/openerp/addons/report/models/report.py", line 166, in get_html return particularreport_obj.render_html(cr, uid, ids, data=data, context=context) File "/usr/lib/python2.7/dist-packages/openerp/api.py", line 250, in wrapper return old_api(self, _args, _kwargs) File "/usr/lib/python2.7/dist-packages/openerp/addons/report/models/abstract_report.py", line 66, in render_html return self.pool['report'].render(cr, uid, [], self._template, docargs, context=context) File "/usr/lib/python2.7/dist-packages/openerp/api.py", line 250, in wrapper return old_api(self, _args, _kwargs) File "/usr/lib/python2.7/dist-packages/openerp/addons/website_report/report.py", line 47, in render return super(Report, self).render(cr, uid, ids, template, values=values, context=context) File "/usr/lib/python2.7/dist-packages/openerp/api.py", line 250, in wrapper return old_api(self, _args, _kwargs) File "/usr/lib/python2.7/dist-packages/openerp/addons/report/models/report.py", line 152, in render return view_obj.render(cr, uid, template, values, context=context) File "/usr/lib/python2.7/dist-packages/openerp/api.py", line 250, in wrapper return old_api(self, _args, _kwargs) File "/usr/lib/python2.7/dist-packages/openerp/addons/website/models/ir_ui_view.py", line 172, in render return super(view, self).render(cr, uid, id_or_xml_id, values=values, engine=engine, context=context) File "/usr/lib/python2.7/dist-packages/openerp/api.py", line 250, in wrapper return old_api(self, _args, _kwargs) File "/usr/lib/python2.7/dist-packages/openerp/addons/base/ir/ir_ui_view.py", line 1017, in render return self.pool[engine].render(cr, uid, id_or_xml_id, qcontext, loader=loader, context=context) File "/usr/lib/python2.7/dist-packages/openerp/api.py", line 250, in wrapper return old_api(self, _args, *_kwargs) File "/usr/lib/python2.7/dist-packages/openerp/addons/base/ir/ir_qweb.py", line 263, in render return self.render_node(self.get_template(id_or_xml_id, qwebcontext), qwebcontext) File "/usr/lib/python2.7/dist-packages/openerp/addons/base/ir/ir_qweb.py", line 302, in render_node result = self.render_element(element, template_attributes, generated_attributes, qwebcontext) File "/usr/lib/python2.7/dist-packages/openerp/addons/base/ir/ir_qweb.py", line 323, in render_element g_inner.append(self.render_node(current_node, qwebcontext)) File "/usr/lib/python2.7/dist-packages/openerp/addons/base/ir/ir_qweb.py", line 302, in render_node result = self.render_element(element, template_attributes, generated_attributes, qwebcontext) File "/usr/lib/python2.7/dist-packages/openerp/addons/base/ir/ir_qweb.py", line 323, in render_element g_inner.append(self.render_node(current_node, qwebcontext)) File "/usr/lib/python2.7/dist-packages/openerp/addons/base/ir/ir_qweb.py", line 302, in render_node result = self.render_element(element, template_attributes, generated_attributes, qwebcontext) File "/usr/lib/python2.7/dist-packages/openerp/addons/base/ir/ir_qweb.py", line 323, in render_element g_inner.append(self.render_node(current_node, qwebcontext)) File "/usr/lib/python2.7/dist-packages/openerp/addons/base/ir/ir_qweb.py", line 302, in render_node result = self.render_element(element, template_attributes, generated_attributes, qwebcontext) File "/usr/lib/python2.7/dist-packages/openerp/addons/base/ir/ir_qweb.py", line 323, in render_element g_inner.append(self.render_node(current_node, qwebcontext)) File "/usr/lib/python2.7/dist-packages/openerp/addons/base/ir/ir_qweb.py", line 300, in render_node result = self._render_tagt_render http://self,%20element,%20template_attributes,%20generated_attributes,%20qwebcontext File "/usr/lib/python2.7/dist-packages/openerp/addons/base/ir/ir_qweb.py", line 424, in render_tag_foreach ru.append(self.render_element(element, template_attributes, generated_attributes, copy_qwebcontext)) File "/usr/lib/python2.7/dist-packages/openerp/addons/base/ir/ir_qweb.py", line 323, in render_element g_inner.append(self.render_node(current_node, qwebcontext)) File "/usr/lib/python2.7/dist-packages/openerp/addons/base/ir/ir_qweb.py", line 300, in render_node result = self._render_tagt_render http://self,%20element,%20template_attributes,%20generated_attributes,%20qwebcontext File "/usr/lib/python2.7/dist-packages/openerp/addons/base/ir/ir_qweb.py", line 424, in render_tag_foreach ru.append(self.render_element(element, template_attributes, generated_attributes, copy_qwebcontext)) File "/usr/lib/python2.7/dist-packages/openerp/addons/base/ir/ir_qweb.py", line 323, in render_element g_inner.append(self.render_node(current_node, qwebcontext)) File "/usr/lib/python2.7/dist-packages/openerp/addons/base/ir/ir_qweb.py", line 302, in render_node result = self.render_element(element, template_attributes, generated_attributes, qwebcontext) File "/usr/lib/python2.7/dist-packages/openerp/addons/base/ir/ir_qweb.py", line 323, in render_element g_inner.append(self.render_node(current_node, qwebcontext)) File "/usr/lib/python2.7/dist-packages/openerp/addons/base/ir/ir_qweb.py", line 284, in render_node self, element, attribute_name, attribute_value, qwebcontext) File "/usr/lib/python2.7/dist-packages/openerp/addons/base/ir/ir_qweb.py", line 359, in render_att_att return [(attribute_name[6:], self.eval(attribute_value, qwebcontext))] File "/usr/lib/python2.7/dist-packages/openerp/addons/base/ir/ir_qweb.py", line 207, in eval raise_qweb_exception(message="Could not evaluate expression %r" % expr, expression=expr, template=template) File "/usr/lib/python2.7/dist-packages/openerp/addons/base/ir/ir_qweb.py", line 204, in eval return qwebcontext.safe_eval(expr) File "/usr/lib/python2.7/dist-packages/openerp/addons/base/ir/ir_qweb.py", line 89, in safe_eval return eval(expr, None, locals_dict, nocopy=True, locals_builtins=True) File "/usr/lib/python2.7/dist-packages/openerp/tools/safe_eval.py", line 314, in safe_eval return eval(c, globals_dict, locals_dict) File "", line 1, in File "/usr/lib/python2.7/dist-packages/openerp/addons/product_barcode_qweb/report/product_barcode_print.py", line 73, in _generateBarcode Code128().getImage(barcode_string, path="./").save(fp,"PNG") File "/usr/lib/python2.7/dist-packages/openerp/addons/product_barcode_qweb/report/Code128.py", line 233, in getImage decodeFontFile(courB08_pil ,path+"courB08.pil") File "/usr/lib/python2.7/dist-packages/openerp/addons/product_barcode_qweb/report/Code128.py", line 274, in decodeFontFile open (file, "wb").write(decompress(decodestring(data))) QWebException: "13 Permission denied" while evaluating "'data:image/png;base64,'+generateBarcode(label_data['default_code'])"

— Reply to this email directly or view it on GitHub https://github.com/TheCloneMaster/product_barcode_qweb/issues/2.

Whytehorse commented 8 years ago

How do I get the variable value? Is that in developer mode or...?