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

UnicodeEncodeError

Subscribe

Get notified when there's activity on this post

This question has been flagged
invoiceprintreportencodingutf8
9 Replies
16612 Views
Avatar
Marko

When trying to print a an invoice I get:

2014-07-29 06:08:51,048 1057 ERROR openerp openerp.service.web_services: Exception: 'ascii' codec can't encode character u'\u010d' in position 6: ordinal not in range(128)
Traceback (most recent call last):
  File "/opt/openerp-7.0-20140728-231228/openerp/service/web_services.py", line 712, in go
    (result, format) = obj.create(cr, uid, ids, datas, context)
  File "/opt/openerp-7.0-20140728-231228/openerp/report/report_sxw.py", line 442, in create
    fnct_ret = fnct(cr, uid, ids, data, report_xml, context)
  File "/opt/openerp-7.0-20140728-231228/openerp/report/report_sxw.py", line 476, in create_source_pdf
    result = self.create_single_pdf(cr, uid, [obj.id], data, report_xml, context)
  File "/opt/openerp-7.0-20140728-231228/openerp/report/report_sxw.py", line 533, in create_single_pdf
    pdf = create_doc(etree.tostring(processed_rml),rml_parser.localcontext,logo,title.encode('utf8'))
  File "/opt/openerp-7.0-20140728-231228/openerp/report/interface.py", line 206, in create_pdf
    obj.render()
  File "/opt/openerp-7.0-20140728-231228/openerp/report/render/render.py", line 59, in render
    self._result = self._render()
  File "/opt/openerp-7.0-20140728-231228/openerp/report/render/rml.py", line 41, in _render
    return rml2pdf.parseNode(self.rml, self.localcontext, images=self.bin_datas, path=self.path,title=self.title)
  File "/opt/openerp-7.0-20140728-231228/openerp/report/render/rml2pdf/trml2pdf.py", line 1032, in parseNode
    r.render(fp)
  File "/opt/openerp-7.0-20140728-231228/openerp/report/render/rml2pdf/trml2pdf.py", line 328, in render
    pt_obj.render(el)
  File "/opt/openerp-7.0-20140728-231228/openerp/report/render/rml2pdf/trml2pdf.py", line 1012, in render
    self.doc_tmpl.build(fis)
  File "/usr/lib/python2.7/dist-packages/reportlab/platypus/doctemplate.py", line 890, in build
    self.handle_flowable(flowables)
  File "/usr/lib/python2.7/dist-packages/reportlab/platypus/doctemplate.py", line 773, in handle_flowable
    if frame.add(f, canv, trySplit=self.allowSplitting):
  File "/usr/lib/python2.7/dist-packages/reportlab/platypus/frames.py", line 161, in _add
    w, h = flowable.wrap(aW, h)
  File "/usr/lib/python2.7/dist-packages/reportlab/platypus/tables.py", line 1173, in wrap
    self._calc(availWidth, availHeight)
  File "/usr/lib/python2.7/dist-packages/reportlab/platypus/tables.py", line 625, in _calc
    self._calc_height(availHeight,availWidth,W=W)
  File "/usr/lib/python2.7/dist-packages/reportlab/platypus/tables.py", line 556, in _calc_height
    dW,t = self._listCellGeom(v,w or self._listValueWidth(v),s)
  File "/usr/lib/python2.7/dist-packages/reportlab/platypus/tables.py", line 397, in _listCellGeom
    vw, vh = v.wrapOn(canv, aW, aH)
  File "/usr/lib/python2.7/dist-packages/reportlab/platypus/flowables.py", line 121, in wrapOn
    w, h = self.wrap(aW,aH)
  File "/usr/lib/python2.7/dist-packages/reportlab/platypus/paragraph.py", line 1036, in wrap
    blPara = self.breakLines([first_line_width, later_widths])
  File "/usr/lib/python2.7/dist-packages/reportlab/platypus/paragraph.py", line 1244, in breakLines
    words[0:0] = _splitWord(word,maxWidth-spaceWidth-currentWidth,maxWidths,lineno,fontName,fontSize,self.encoding)
  File "/usr/lib/python2.7/dist-packages/reportlab/platypus/paragraph.py", line 553, in _splitWord
    R.append(_SplitText(wordText))
UnicodeEncodeError: 'ascii' codec can't encode character u'\u010d' in position 6: ordinal not in range(128)
2014-07-29 06:08:51,171 1057 ERROR openerp openerp.netsvc: ascii
Jediničn
6
7
ordinal not in range(128)
(<type 'exceptions.UnicodeEncodeError'>, UnicodeEncodeError('ascii', u'Jedini\u010dn', 6, 7, 'ordinal not in range(128)'), <traceback object at 0x7f323abdb9e0>)
Traceback (most recent call last):
  File "/opt/openerp-7.0-20140728-231228/openerp/netsvc.py", line 296, in dispatch_rpc
    result = ExportService.getService(service_name).dispatch(method, params)
  File "/opt/openerp-7.0-20140728-231228/openerp/service/web_services.py", line 654, in dispatch
    res = fn(db, uid, *params)
  File "/opt/openerp-7.0-20140728-231228/openerp/service/web_services.py", line 760, in exp_report_get
    return self._check_report(report_id)
  File "/opt/openerp-7.0-20140728-231228/openerp/service/web_services.py", line 738, in _check_report
    netsvc.abort_response(exc, exc.message, 'warning', exc.traceback)
  File "/opt/openerp-7.0-20140728-231228/openerp/netsvc.py", line 71, in abort_response
    raise openerp.osv.osv.except_osv(description, details)
except_osv: (u'ascii\nJedini\u010dn\n6\n7\nordinal not in range(128)', (<type 'exceptions.UnicodeEncodeError'>, UnicodeEncodeError('ascii', u'Jedini\u010dn', 6, 7, 'ordinal not in range(128)'), <traceback object at 0x7f323abdb9e0>))
2014-07-29 06:08:51,174 1057 INFO openerp werkzeug: 127.0.0.1 - - [29/Jul/2014 06:08:51] "POST /web/report HTTP/1.1" 500 -

 

The language is set to Croatian.

The above error seems to occur when the po files are read for the report like /openerp/addons/account/i18n/hr.po and then it doesn't understand characters like č. Or it can't encode č, I don't know really.

0
Avatar
Discard
JC

On which operating system and version?

OdooBot

This is on Ubuntu 14.4.
This same setup is working on gentoo ( latest).
Thanks

On 12 Aug 2014 12:54, "jc" <jcchua@mail.odoo.com> wrote:

On which operating system and version?

--
jc Sent by OpenERP S.A. using Odoo. Access your messages and documents in Odoo
Avatar
JC
Best Answer

Since you are on ubuntu 14.04, the issue could be due to reportlab 3.0

odoo/openerp7 is using reportlab 2.6 but ubuntu 14.04 upgraded it to reportlab 3.0  Try this:

1) Download reportlab reportlab-2.6.tar.gz (md5)  from https://pypi.python.org/pypi/reportlab/2.6

2) unzip > look for src directory copy reportlab directory to replace reportlab v3 at  /usr/lib/python2.7/dist-packages/reportlab in ubuntu server

3
Avatar
Discard
Pascal Tremblay

Not sure it works on Odoo 8. I can't restart the server if I do this.

Pascal Tremblay

Still this error for me : writer.writerow((module, type, name, res_id, src, trad)) UnicodeEncodeError: 'ascii' codec can't encode characters in position 0-2: ordinal not in range(128). Even with reportlab 2.6.

Avatar
Md Abdur Rahim
Best Answer

I need HELP, anyone please give me solution for this error...

++++++++++++++++



Odoo

Odoo Server Error

Traceback (most recent call last):

File "/opt/odoo/openerp/http.py", line 537, in _handle_exception

return super(JsonRequest, self)._handle_exception(exception)

File "/opt/odoo/openerp/http.py", line 574, in dispatch

result = self._call_function(**self.params)

File "/opt/odoo/openerp/http.py", line 310, in _call_function

return checked_call(self.db, *args, **kwargs)

File "/opt/odoo/openerp/service/model.py", line 113, in wrapper

return f(dbname, *args, **kwargs)

File "/opt/odoo/openerp/http.py", line 307, in checked_call

return self.endpoint(*a, **kw)

File "/opt/odoo/openerp/http.py", line 803, in __call__

return self.method(*args, **kw)

File "/opt/odoo/openerp/http.py", line 403, in response_wrap

response = f(*args, **kw)

File "/opt/odoo/addons/web/controllers/main.py", line 948, in call_button

action = self._call_kw(model, method, args, {})

File "/opt/odoo/addons/web/controllers/main.py", line 936, in _call_kw

return getattr(request.registry.get(model), method)(request.cr, request.uid, *args, **kwargs)

File "/opt/odoo/openerp/api.py", line 241, in wrapper

return old_api(self, *args, **kwargs)

File "/opt/odoo/openerp/addons/base/module/module.py", line 446, in button_immediate_install

return self._button_immediate_function(cr, uid, ids, self.button_install, context=context)

File "/opt/odoo/openerp/api.py", line 241, in wrapper

return old_api(self, *args, **kwargs)

File "/opt/odoo/openerp/addons/base/module/module.py", line 494, in _button_immediate_function

registry = openerp.modules.registry.RegistryManager.new(cr.dbname, update_module=True)

File "/opt/odoo/openerp/modules/registry.py", line 370, in new

openerp.modules.load_modules(registry._db, force_demo, status, update_module)

File "/opt/odoo/openerp/modules/loading.py", line 355, in load_modules

loaded_modules, update_module)

File "/opt/odoo/openerp/modules/loading.py", line 255, in load_marked_modules

loaded, processed = load_module_graph(cr, graph, progressdict, report=report, skip_modules=loaded_modules, perform_checks=perform_checks)

File "/opt/odoo/openerp/modules/loading.py", line 157, in load_module_graph

init_module_models(cr, package.name, models)

File "/opt/odoo/openerp/modules/module.py", line 286, in init_module_models

result = obj._auto_init(cr, {'module': module_name})

File "/opt/odoo/openerp/api.py", line 241, in wrapper

return old_api(self, *args, **kwargs)

File "/opt/odoo/openerp/models.py", line 2636, in _auto_init

self._set_default_value_on_column(cr, k, context=context)

File "/opt/odoo/openerp/api.py", line 241, in wrapper

return old_api(self, *args, **kwargs)

File "/opt/odoo/openerp/models.py", line 2398, in _set_default_value_on_column

default = default(self, cr, SUPERUSER_ID, context)

File "/opt/odoo/addons/account/account.py", line 1219, in _get_period

period_ids = self.pool.get('account.period').find(cr, uid, context=ctx)

File "/opt/odoo/openerp/api.py", line 241, in wrapper

return old_api(self, *args, **kwargs)

File "/opt/odoo/addons/account/account.py", line 1046, in find

model, action_id = self.pool['ir.model.data'].get_object_reference(cr, uid, 'account', 'action_account_period')

File "/opt/odoo/openerp/api.py", line 241, in wrapper

return old_api(self, *args, **kwargs)

File "/opt/odoo/openerp/addons/base/ir/ir_model.py", line 968, in get_object_reference

return self.xmlid_lookup(cr, uid, "%s.%s" % (module, xml_id))[1:3]

File "/opt/odoo/openerp/api.py", line 241, in wrapper

return old_api(self, *args, **kwargs)

File "<string>", line 2, in xmlid_lookup

File "/opt/odoo/openerp/tools/cache.py", line 74, in lookup

value = d[key] = self.method(*args, **kwargs)

File "/opt/odoo/openerp/addons/base/ir/ir_model.py", line 926, in xmlid_lookup

raise ValueError('External ID not found in the system: %s' % (xmlid))

ValueError: External ID not found in the system: account.action_account_period

0
Avatar
Discard
Avatar
Balvant Ramani
Best Answer

i faced same problem. please help.


return self.app(environ, start_wrapped)

File "/usr/lib/python2.7/dist-packages/werkzeug/wsgi.py", line 579, in __call__

return self.app(environ, start_response)

File "/opt/odoo/openerp/http.py", line 1441, in dispatch

return response(environ, start_response)

File "/usr/lib/python2.7/dist-packages/werkzeug/wrappers.py", line 1200, in __call__

app_iter, status, headers = self.get_wsgi_response(environ)

File "/usr/lib/python2.7/dist-packages/werkzeug/wrappers.py", line 1190, in get_wsgi_response

return app_iter, self.status, headers.to_wsgi_list()

File "/usr/lib/python2.7/dist-packages/werkzeug/datastructures.py", line 1185, in to_wsgi_list

return [(k, v.encode('latin1')) for k, v in self]

UnicodeEncodeError: 'latin-1' codec can't encode characters in position 49-53: ordinal not in range(256)


0
Avatar
Discard
Avatar
Gratien HOUNDAKO
Best Answer

thanks jc :-)

0
Avatar
Discard
Avatar
Marko
Author Best Answer

That was it, thanks jc :-)

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
Strip string from a field with defined separator in invoice report Solved
invoice print custom report
Avatar
1
Mar 22
3228
Issue in printing custom invoice report?
invoice print report odoo10
Avatar
Avatar
1
Aug 17
6564
report.external_layout lost unable to print quotation/invoices Odoo 8 Solved
invoice print report quotation odooV8
Avatar
Avatar
1
Dec 21
4868
Display report based on condition in "Print" dropdown
invoice customer print supplier report
Avatar
0
Jun 17
3818
Sometimes, Invoice Report is loading, but not showing...
invoice print report not showing
Avatar
0
Mar 15
4966
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