跳至內容
Odoo 選單
  • 登入
  • 免費試用
  • 應用程式
    財政
    • 會計
    • 發票
    • 開支報銷
    • 試算表 (BI)
    • 文件管理
    • 電子簽名
    銷售
    • 客戶關係
    • 銷售
    • POS 銷售點管理 - 零售
    • POS 銷售點管理 - 餐廳
    • 訂閱
    • 租賃
    網站
    • 網站製作
    • 電子商務
    • 網誌
    • 討論區
    • 線上客服
    • 網上學習
    供應鏈
    • 庫存
    • 製造管理
    • 產品生命周期
    • 採購
    • 保養維護
    • 品質管理
    人力資源
    • 員工管理
    • 招聘
    • 休假
    • 工作表現評核
    • 內部推薦
    • 車隊管理
    市場推廣
    • 社交媒體推廣
    • 電郵推廣
    • 短訊營銷
    • 活動
    • 自動化推廣
    • 網上調查
    服務
    • 專案管理
    • 工時管理
    • 外勤服務管理
    • 技術支援
    • 工作規劃
    • 預約管理
    生產力
    • 聊天
    • 批核
    • 物聯網
    • VoIP
    • 知識庫
    • WhatsApp
    第三方應用程式 Odoo Studio Odoo 雲端平台
  • 行業
    零售
    • 書店
    • 服裝店
    • 家具店
    • 食品雜貨店
    • 五金店
    • 玩具店
    餐飲及款待
    • 酒吧及酒館
    • 餐廳
    • 快餐
    • 賓館
    • 飲品分銷商
    • 酒店
    房地產
    • 地產代理公司
    • 建築師事務所
    • 建造業
    • 物業管理
    • 園藝
    • 業主聯會
    顧問服務
    • 會計公司
    • Odoo 合作夥伴
    • 市場推廣公司
    • 律師事務所
    • 人才招募
    • 審計及認證
    製造管理
    • 紡織
    • 金屬
    • 家具
    • 食品
    • 啤酒廠
    • 企業禮品
    保健與健身
    • 運動俱樂部
    • 眼鏡店
    • 健身中心
    • 健康從業人員
    • 藥房
    • 髮型屋
    技術行業
    • 雜工
    • IT 硬體與支援
    • 太陽能系統
    • 鞋匠
    • 清潔服務
    • 暖通空調服務
    其他
    • 非牟利組織
    • 環境保護機構
    • 廣告板租賃
    • 攝影服務
    • 自行車租賃
    • 軟體經銷商
    瀏覽所有行業
  • 社群
    學習
    • 教學影片
    • 使用說明
    • 認證
    • 培訓
    • 網誌
    • Podcast
    增強教學效能
    • 教育計劃
    • Scale Up! 商業遊戲
    • 到訪 Odoo
    取得軟件
    • 下載
    • 版本對照表
    • 版本說明
    合作
    • GitHub
    • 討論區
    • 活動
    • 翻譯
    • 成為合作夥伴
    • 合作夥伴服務
    • 登記你的會計服務公司
    獲取服務相關資料
    • 尋找合作夥伴
    • 尋找會計服務
    • 預約顧問諮詢
    • 安裝及推行服務
    • 客戶案例
    • 支援
    • 軟件升級
    GitHub YouTube Twitter LinkedIn Instagram Facebook Spotify
    +1 (650) 691-3277
    預約示範
  • 定價
  • 技術支援

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

  • 客戶關係
  • e-Commerce
  • 會計
  • 庫存
  • PoS
  • 專案管理
  • MRP
All apps
只限註冊用戶才可與社群互動。
所有帖文 人 獎章
標籤 (查看所有)
odoo accounting v14 pos v15
關於此討論區
只限註冊用戶才可與社群互動。
所有帖文 人 獎章
標籤 (查看所有)
odoo accounting v14 pos v15
關於此討論區
支援

UnicodeEncodeError

訂閱

此帖文有活動時,接收通知

此問題已被標幟
invoiceprintreportencodingutf8
9 回覆
16619 瀏覽次數
頭像
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
頭像
捨棄
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
頭像
JC
最佳答案

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
頭像
捨棄
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.

頭像
Md Abdur Rahim
最佳答案

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
頭像
捨棄
頭像
Balvant Ramani
最佳答案

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
頭像
捨棄
頭像
Gratien HOUNDAKO
最佳答案

thanks jc :-)

0
頭像
捨棄
頭像
Marko
作者 最佳答案

That was it, thanks jc :-)

0
頭像
捨棄
喜歡這則討論?不要只閱讀,加入發表意見吧!

今天就建立帳戶,享受獨家功能,與我們精彩的社群互動!

註冊
相關帖文 回覆 瀏覽次數 活動
Strip string from a field with defined separator in invoice report 已解決
invoice print custom report
頭像
1
3月 22
3229
Issue in printing custom invoice report?
invoice print report odoo10
頭像
頭像
1
8月 17
6564
report.external_layout lost unable to print quotation/invoices Odoo 8 已解決
invoice print report quotation odooV8
頭像
頭像
1
12月 21
4870
Display report based on condition in "Print" dropdown
invoice customer print supplier report
頭像
0
6月 17
3818
Sometimes, Invoice Report is loading, but not showing...
invoice print report not showing
頭像
0
3月 15
4972
社群
  • 教學影片
  • 使用說明
  • 討論區
開源
  • 下載
  • GitHub
  • Runbot 測試環境
  • 翻譯
服務
  • odoo.sh 網頁寄存
  • 支援
  • 升級
  • 自訂功能開發
  • 教育及培訓
  • 尋找會計服務
  • 尋找合作夥伴
  • 成為合作夥伴
關於我們
  • 關於 Odoo 公司
  • 品牌資產
  • 聯絡我們
  • 招聘
  • 活動
  • Podcast
  • 網誌
  • 客戶
  • 法律 • 私隱政策
  • 安全性
الْعَرَبيّة 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 是一套開放源碼的商業管理系統,涵蓋你公司全部的營運需要,包括客戶關係管理(CRM)、電子商務、會計、庫存管理、POS(銷售點管理)、專案管理等應用程式。

Odoo 的獨特價值是非常簡單易用,同時將不同應用程式完美整合。

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