Skip to Content
Odoo Menú
  • Registra entrada
  • Prova-ho gratis
  • Aplicacions
    Finances
    • Comptabilitat
    • Facturació
    • Despeses
    • Full de càlcul (IA)
    • Documents
    • Signatura
    Vendes
    • CRM
    • Vendes
    • Punt de venda per a botigues
    • Punt de venda per a restaurants
    • Subscripcions
    • Lloguer
    Imatges de llocs web
    • Creació de llocs web
    • Comerç electrònic
    • Blog
    • Fòrum
    • Xat en directe
    • Aprenentatge en línia
    Cadena de subministrament
    • Inventari
    • Fabricació
    • PLM
    • Compres
    • Manteniment
    • Qualitat
    Recursos humans
    • Empleats
    • Reclutament
    • Absències
    • Avaluacions
    • Recomanacions
    • Flota
    Màrqueting
    • Màrqueting Social
    • Màrqueting per correu electrònic
    • Màrqueting per SMS
    • Esdeveniments
    • Automatització del màrqueting
    • Enquestes
    Serveis
    • Projectes
    • Fulls d'hores
    • Servei de camp
    • Suport
    • Planificació
    • Cites
    Productivitat
    • Converses
    • Validacions
    • IoT
    • VoIP
    • Coneixements
    • WhatsApp
    Aplicacions de tercers Odoo Studio Plataforma d'Odoo al núvol
  • Sectors
    Comerç al detall
    • Llibreria
    • Botiga de roba
    • Botiga de mobles
    • Botiga d'ultramarins
    • Ferreteria
    • Botiga de joguines
    Food & Hospitality
    • Bar i pub
    • Restaurant
    • Menjar ràpid
    • Guest House
    • Distribuïdor de begudes
    • Hotel
    Immobiliari
    • Agència immobiliària
    • Estudi d'arquitectura
    • Construcció
    • Gestió immobiliària
    • Jardineria
    • Associació de propietaris de béns immobles
    Consultoria
    • Empresa comptable
    • Partner d'Odoo
    • Agència de màrqueting
    • Bufet d'advocats
    • Captació de talent
    • Auditoria i certificació
    Fabricació
    • Textile
    • Metal
    • Mobles
    • Menjar
    • Brewery
    • Regals corporatius
    Salut i fitness
    • Club d'esport
    • Òptica
    • Centre de fitness
    • Especialistes en benestar
    • Farmàcia
    • Perruqueria
    Trades
    • Servei de manteniment
    • Hardware i suport informàtic
    • Sistemes d'energia solar
    • Shoe Maker
    • Serveis de neteja
    • Instal·lacions HVAC
    Altres
    • Nonprofit Organization
    • Agència del medi ambient
    • Lloguer de panells publicitaris
    • Fotografia
    • Lloguer de bicicletes
    • Distribuïdors de programari
    Browse all Industries
  • Comunitat
    Aprèn
    • Tutorials
    • Documentació
    • Certificacions
    • Formació
    • Blog
    • Pòdcast
    Potenciar l'educació
    • Programa educatiu
    • Scale-Up! El joc empresarial
    • Visita Odoo
    Obtindre el programari
    • Descarregar
    • Comparar edicions
    • Novetats de les versions
    Col·laborar
    • GitHub
    • Fòrum
    • Esdeveniments
    • Traduccions
    • Converteix-te en partner
    • Services for Partners
    • Registra la teva empresa comptable
    Obtindre els serveis
    • Troba un partner
    • Troba un comptable
    • Contacta amb un expert
    • Serveis d'implementació
    • Referències del client
    • Suport
    • Actualitzacions
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Programar una demo
  • Preus
  • Ajuda

Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:

  • CRM
  • e-Commerce
  • Comptabilitat
  • Inventari
  • PoS
  • Projectes
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Etiquetes (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Etiquetes (View all)
odoo accounting v14 pos v15
About this forum
Ajuda

QWebException: "13 Permission denied" Error in Qweb report(with barcode)

Subscriure's

Get notified when there's activity on this post

This question has been flagged
barcodeQWebException
3 Respostes
7693 Vistes
Avatar
bhavik vyas

I have developed one qweb report with barcode .I have tested it on four different system and it works perfectly ,but on client's server it gives following error during report printing


File "/opt/openerp/odoo/openerp/addons/base/ir/ir_qweb.py", line 315, in render_element
g_inner.append(self.render_node(current_node, qwebcontext))
File "/opt/openerp/odoo/openerp/addons/base/ir/ir_qweb.py", line 294, in render_node
result = self.render_element(element, template_attributes, generated_attributes, qwebcontext)
File "/opt/openerp/odoo/openerp/addons/base/ir/ir_qweb.py", line 315, in render_element
g_inner.append(self.render_node(current_node, qwebcontext))
File "/opt/openerp/odoo/openerp/addons/base/ir/ir_qweb.py", line 294, in render_node
result = self.render_element(element, template_attributes, generated_attributes, qwebcontext)
File "/opt/openerp/odoo/openerp/addons/base/ir/ir_qweb.py", line 315, in render_element
g_inner.append(self.render_node(current_node, qwebcontext))
File "/opt/openerp/odoo/openerp/addons/base/ir/ir_qweb.py", line 274, in render_node
self, element, attribute_name, attribute_value, qwebcontext)
File "/opt/openerp/odoo/openerp/addons/base/ir/ir_qweb.py", line 351, in render_att_att
return [(attribute_name[6:], self.eval(attribute_value, qwebcontext))]
File "/opt/openerp/odoo/openerp/addons/base/ir/ir_qweb.py", line 197, in eval
raise_qweb_exception(message="Could not evaluate expression %r" % expr, expression=expr, template=template)
File "/opt/openerp/odoo/openerp/addons/base/ir/ir_qweb.py", line 194, in eval
return qwebcontext.safe_eval(expr)
File "/opt/openerp/odoo/openerp/addons/base/ir/ir_qweb.py", line 80, in safe_eval
return eval(expr, None, locals_dict, nocopy=True, locals_builtins=True)
File "/opt/openerp/odoo/openerp/tools/safe_eval.py", line 313, in safe_eval
return eval(c, globals_dict, locals_dict)
File "", line 1, in <module>
File "/home/ols1/extra_addons/product_barcode_qweb/report/product_barcode_print.py", line 62, in _generateBarcode
Code128().getImage(barcode_string, path="./").save(fp, "PNG")
File "/home/ols1/extra_addons/product_barcode_qweb/report/Code128.py", line 234, in getImage
decodeFontFile(courB08_pil ,path+"courB08.pil")
File "/home/ols1/extra_addons/product_barcode_qweb/report/Code128.py", line 276, in decodeFontFile
open (file, "wb").write(decompress(decodestring(data)))
QWebException: "13
Permission denied" while evaluating
"'data:image/png;base64,'+generateBarcode(label_data['default_code'])"
0
Avatar
Descartar
bhavik vyas
Autor

Stuck around this problem from last 3 days!Even a single clue will be great help!

Avatar
Temur
Best Answer

see the fragment from your error log in the question post above:

File "/home/ols1/extra_addons/product_barcode_qweb/report/product_barcode_print.py", line 62, in _generateBarcode
Code128().getImage(barcode_string, path="./").save(fp, "PNG")

here you try to save file to current directory, but you do not have necessary permissions on the current directory. I suggest following changes in product_barcode_print.py:

import os

from openerp.tools import config

my_data_directory = os.path.join(config['data_dir'], "custom_filestore", "your_module_name")

if not os.path.exists(my_data_directory):
    os.makedirs(my_data_directory)

then, in the code at line 62: Code128().getImage(barcode_string, path="./").save(fp, "PNG") -Use my_data_directory instead of "./" -local directory:

Code128().getImage(barcode_string, path=my_data_directory ).save(fp, "PNG")

also adapt the rest of code to accordingly use my_data_directory instead of local directory to read from and write to file(s) you create in your module. that's it, after this change you save files to directory where you have all necessary permissions. 


NOTE:

Above changes should be enough in your case, but, in the best case you should append database name to data_directory path, so you'll have separated directory for each database in a multidatabase environment. in v8 it may be implemented as:

@api.model
def get_custom_data_dir(self):
return os.path.join(config['data_dir'], "custom_filestore", "module_name", self.env.cr.dbname)

optionally you can use this approach, if it's necessary.

3
Avatar
Descartar
bhavik vyas
Autor

Thank you very much Temur! you understood my issues perfectly! i followed your instructions and issue solved!

Temur

You're welcome!

Avatar
jhony
Best Answer

This is pretty simple @bhavik you don't have required permission on file.

0
Avatar
Descartar
Enjoying the discussion? Don't just read, join in!

Create an account today to enjoy exclusive features and engage with our awesome community!

Registrar-se
Related Posts Respostes Vistes Activitat
Can I remove the "Product Barcode Lookup" module from my database? Solved
barcode
Avatar
Avatar
Avatar
2
de set. 25
780
How can I customize product labels to show additional information?
barcode
Avatar
Avatar
Avatar
2
de set. 25
1112
Barcode - Process and Cancel MOs Using Barcodes (last chapter)
barcode
Avatar
0
de febr. 25
2134
Default barcode nomenclature
barcode
Avatar
0
de des. 24
46
Find product by name scanning barcode & regex segmentation
barcode
Avatar
0
de des. 24
1773
Community
  • Tutorials
  • Documentació
  • Fòrum
Codi obert
  • Descarregar
  • GitHub
  • Runbot
  • Traduccions
Serveis
  • Allotjament a Odoo.sh
  • Suport
  • Actualització
  • Desenvolupaments personalitzats
  • Educació
  • Troba un comptable
  • Troba un partner
  • Converteix-te en partner
Sobre nosaltres
  • La nostra empresa
  • Actius de marca
  • Contacta amb nosaltres
  • Llocs de treball
  • Esdeveniments
  • Pòdcast
  • Blog
  • Clients
  • Informació legal • Privacitat
  • Seguretat
الْعَرَبيّة Català 简体中文 繁體中文 (台灣) Čeština Dansk Nederlands English Suomi Français Deutsch हिंदी Bahasa Indonesia Italiano 日本語 한국어 (KR) Lietuvių kalba Język polski Português (BR) română русский язык Slovenský jazyk slovenščina Español (América Latina) Español ภาษาไทย Türkçe українська Tiếng Việt

Odoo és un conjunt d'aplicacions empresarials de codi obert que cobreix totes les necessitats de la teva empresa: CRM, comerç electrònic, comptabilitat, inventari, punt de venda, gestió de projectes, etc.

La proposta única de valor d'Odoo és ser molt fàcil d'utilitzar i estar totalment integrat, ambdues alhora.

Website made with

Odoo Experience on YouTube

1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.

Live support on Youtube
Watch now