Se rendre au contenu
Odoo Menu
  • Se connecter
  • Essai gratuit
  • Applications
    Finance
    • Comptabilité
    • Facturation
    • Notes de frais
    • Feuilles de calcul (BI)
    • Documents
    • Signature
    Ventes
    • CRM
    • Ventes
    • PdV Boutique
    • PdV Restaurant
    • Abonnements
    • Location
    Sites web
    • Site Web
    • eCommerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Chaîne d'approvisionnement
    • Inventaire
    • Fabrication
    • PLM
    • Achats
    • Maintenance
    • Qualité
    Ressources Humaines
    • Employés
    • Recrutement
    • Congés
    • Évaluations
    • Recommandations
    • Parc automobile
    Marketing
    • Marketing Social
    • E-mail Marketing
    • SMS Marketing
    • Événements
    • Marketing Automation
    • Sondages
    Services
    • Projet
    • Feuilles de temps
    • Services sur Site
    • Assistance
    • Planification
    • Rendez-vous
    Productivité
    • Discussion
    • Validations
    • Internet des Objets
    • VoIP
    • Connaissances
    • WhatsApp
    Applications tierces Odoo Studio Plateforme Cloud d'Odoo
  • Industries
    Commerce de détail
    • Librairie
    • Magasin de vêtements
    • Magasin de meubles
    • Épicerie
    • Quincaillerie
    • Magasin de jouets
    Food & Hospitality
    • Bar et Pub
    • Restaurant
    • Fast-food
    • Maison d’hôtes
    • Distributeur de boissons
    • Hôtel
    Immobilier
    • Agence immobilière
    • Cabinet d'architecture
    • Construction
    • Gestion immobilière
    • Jardinage
    • Association de copropriétaires
    Consultance
    • Cabinet d'expertise comptable
    • Partenaire Odoo
    • Agence Marketing
    • Cabinet d'avocats
    • Aquisition de talents
    • Audit & Certification
    Fabrication
    • Textile
    • Métal
    • Meubles
    • Alimentation
    • Brewery
    • Cadeaux d'entreprise
    Santé & Fitness
    • Club de sports
    • Opticien
    • Salle de fitness
    • Praticiens bien-être
    • Pharmacie
    • Salon de coiffure
    Trades
    • Bricoleur
    • Matériel informatique et support
    • Systèmes photovoltaïques
    • Cordonnier
    • Services de nettoyage
    • Services CVC
    Autres
    • Organisation à but non lucratif
    • Agence environnementale
    • Location de panneaux d'affichage
    • Photographie
    • Leasing de vélos
    • Revendeur de logiciel
    Browse all Industries
  • Communauté
    Apprenez
    • Tutoriels
    • Documentation
    • Certifications
    • Formation
    • Blog
    • Podcast
    Renforcer l'éducation
    • Programme éducatif
    • Business Game Scale-Up!
    • Rendez-nous visite
    Obtenir le logiciel
    • Téléchargement
    • Comparez les éditions
    • Versions
    Collaborer
    • Github
    • Forum
    • Événements
    • Traductions
    • Devenez partenaire
    • Services for Partners
    • Enregistrer votre cabinet comptable
    Nos Services
    • Trouver un partenaire
    • Trouver un comptable
    • Rencontrer un conseiller
    • Services de mise en œuvre
    • Références clients
    • Assistance
    • Mises à niveau
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Obtenir une démonstration
  • Tarification
  • Aide

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

  • CRM
  • e-Commerce
  • Comptabilité
  • Inventaire
  • PoS
  • Projet
  • MRP
All apps
Vous devez être inscrit pour interagir avec la communauté.
Toutes les publications Personnes Badges
Étiquettes (Voir toutl)
odoo accounting v14 pos v15
À propos de ce forum
Vous devez être inscrit pour interagir avec la communauté.
Toutes les publications Personnes Badges
Étiquettes (Voir toutl)
odoo accounting v14 pos v15
À propos de ce forum
Aide

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

S'inscrire

Recevez une notification lorsqu'il y a de l'activité sur ce poste

Cette question a été signalée
barcodeQWebException
3 Réponses
7678 Vues
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
Ignorer
bhavik vyas
Auteur

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

Avatar
Temur
Meilleure réponse

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
Ignorer
bhavik vyas
Auteur

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

Temur

You're welcome!

Avatar
jhony
Meilleure réponse

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

0
Avatar
Ignorer
Vous appréciez la discussion ? Ne vous contentez pas de lire, rejoignez-nous !

Créez un compte dès aujourd'hui pour profiter de fonctionnalités exclusives et échanger avec notre formidable communauté !

S'inscrire
Publications associées Réponses Vues Activité
Can I remove the "Product Barcode Lookup" module from my database? Résolu
barcode
Avatar
Avatar
Avatar
2
sept. 25
776
How can I customize product labels to show additional information?
barcode
Avatar
Avatar
Avatar
2
sept. 25
1109
Barcode - Process and Cancel MOs Using Barcodes (last chapter)
barcode
Avatar
0
févr. 25
2133
Default barcode nomenclature
barcode
Avatar
0
déc. 24
46
Find product by name scanning barcode & regex segmentation
barcode
Avatar
0
déc. 24
1771
Communauté
  • Tutoriels
  • Documentation
  • Forum
Open Source
  • Téléchargement
  • Github
  • Runbot
  • Traductions
Services
  • Hébergement Odoo.sh
  • Assistance
  • Migration
  • Développements personnalisés
  • Éducation
  • Trouver un comptable
  • Trouver un partenaire
  • Devenez partenaire
À propos
  • Notre société
  • Actifs de la marque
  • Contactez-nous
  • Emplois
  • Événements
  • Podcast
  • Blog
  • Clients
  • Informations légales • Confidentialité
  • Sécurité.
الْعَرَبيّة 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 est une suite d'applications open source couvrant tous les besoins de votre entreprise : CRM, eCommerce, Comptabilité, Inventaire, Point de Vente, Gestion de Projet, etc.

Le positionnement unique d'Odoo est d'être à la fois très facile à utiliser et totalement intégré.

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