Skip to Content
Odoo Menu
  • Sign in
  • Try it free
  • Apps
    Finance
    • Accounting
    • Invoicing
    • Expenses
    • Spreadsheet (BI)
    • Documents
    • Sign
    Sales
    • CRM
    • Sales
    • POS Shop
    • POS Restaurant
    • Subscriptions
    • Rental
    Websites
    • Website Builder
    • eCommerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Supply Chain
    • Inventory
    • Manufacturing
    • PLM
    • Purchase
    • Maintenance
    • Quality
    Human Resources
    • Employees
    • Recruitment
    • Time Off
    • Appraisals
    • Referrals
    • Fleet
    Marketing
    • Social Marketing
    • Email Marketing
    • SMS Marketing
    • Events
    • Marketing Automation
    • Surveys
    Services
    • Project
    • Timesheets
    • Field Service
    • Helpdesk
    • Planning
    • Appointments
    Productivity
    • Discuss
    • Approvals
    • IoT
    • VoIP
    • Knowledge
    • WhatsApp
    Third party apps Odoo Studio Odoo Cloud Platform
  • Industries
    Retail
    • Book Store
    • Clothing Store
    • Furniture Store
    • Grocery Store
    • Hardware Store
    • Toy Store
    Food & Hospitality
    • Bar and Pub
    • Restaurant
    • Fast Food
    • Guest House
    • Beverage Distributor
    • Hotel
    Real Estate
    • Real Estate Agency
    • Architecture Firm
    • Construction
    • Estate Management
    • Gardening
    • Property Owner Association
    Consulting
    • Accounting Firm
    • Odoo Partner
    • Marketing Agency
    • Law firm
    • Talent Acquisition
    • Audit & Certification
    Manufacturing
    • Textile
    • Metal
    • Furnitures
    • Food
    • Brewery
    • Corporate Gifts
    Health & Fitness
    • Sports Club
    • Eyewear Store
    • Fitness Center
    • Wellness Practitioners
    • Pharmacy
    • Hair Salon
    Trades
    • Handyman
    • IT Hardware & Support
    • Solar Energy Systems
    • Shoe Maker
    • Cleaning Services
    • HVAC Services
    Others
    • Nonprofit Organization
    • Environmental Agency
    • Billboard Rental
    • Photography
    • Bike Leasing
    • Software Reseller
    Browse all Industries
  • Community
    Learn
    • Tutorials
    • Documentation
    • Certifications
    • Training
    • Blog
    • Podcast
    Empower Education
    • Education Program
    • Scale Up! Business Game
    • Visit Odoo
    Get the Software
    • Download
    • Compare Editions
    • Releases
    Collaborate
    • Github
    • Forum
    • Events
    • Translations
    • Become a Partner
    • Services for Partners
    • Register your Accounting Firm
    Get Services
    • Find a Partner
    • Find an Accountant
    • Meet an advisor
    • Implementation Services
    • Customer References
    • Support
    • Upgrades
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Get a demo
  • Pricing
  • Help

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

  • CRM
  • e-Commerce
  • Accounting
  • Inventory
  • PoS
  • Project
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Tags (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Tags (View all)
odoo accounting v14 pos v15
About this forum
Help

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

Subscribe

Get notified when there's activity on this post

This question has been flagged
barcodeQWebException
3 Replies
7672 Views
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
Discard
bhavik vyas
Author

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
Discard
bhavik vyas
Author

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
Discard
Enjoying the discussion? Don't just read, join in!

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

Sign up
Related Posts Replies Views Activity
Can I remove the "Product Barcode Lookup" module from my database? Solved
barcode
Avatar
Avatar
Avatar
2
Sep 25
772
How can I customize product labels to show additional information?
barcode
Avatar
Avatar
Avatar
2
Sep 25
1098
Barcode - Process and Cancel MOs Using Barcodes (last chapter)
barcode
Avatar
0
Feb 25
2129
Default barcode nomenclature
barcode
Avatar
0
Dec 24
46
Find product by name scanning barcode & regex segmentation
barcode
Avatar
0
Dec 24
1764
Community
  • Tutorials
  • Documentation
  • Forum
Open Source
  • Download
  • Github
  • Runbot
  • Translations
Services
  • Odoo.sh Hosting
  • Support
  • Upgrade
  • Custom Developments
  • Education
  • Find an Accountant
  • Find a Partner
  • Become a Partner
About us
  • Our company
  • Brand Assets
  • Contact us
  • Jobs
  • Events
  • Podcast
  • Blog
  • Customers
  • Legal • Privacy
  • Security
الْعَرَبيّة 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 is a suite of open source business apps that cover all your company needs: CRM, eCommerce, accounting, inventory, point of sale, project management, etc.

Odoo's unique value proposition is to be at the same time very easy to use and fully integrated.

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