← Back to team overview

c2c-oerpscenario team mailing list archive

[Bug 682560] Re: ValueError: redefining named object: 'toUnicodeCMap:AAAAAA+DejaVuSans'

 

Hi,

If I do not use the "base_report_unicode" module, then all my reports
(with Vietnamese characters) are shown up incorrectly (black/empty
boxes). Please advise if base_report_unicode is obsolete, what is the
proper steps to work-around this?

** Attachment added: "openerp_3zPUwv.pdf"
   https://bugs.launchpad.net/openobject-addons/+bug/682560/+attachment/1763628/+files/openerp_3zPUwv.pdf

-- 
You received this bug notification because you are a member of C2C
OERPScenario, which is subscribed to the OpenERP Project Group.
https://bugs.launchpad.net/bugs/682560

Title:
  ValueError: redefining named object: 'toUnicodeCMap:AAAAAA+DejaVuSans'

Status in OpenObject Addons Modules:
  Invalid

Bug description:
  Error generated when loading module account for a newly created DB

[2010-11-29 13:00:08,498][dev60] TEST:tests.account:In order to test the PDF reports defined on an invoice, we will print an Invoice Report
[2010-11-29 13:00:09,199][dev60] DEBUG:tests.account:Exception during evaluation of !python block in yaml_file /var/local/software/openerp-v6.0dev/server/bin/addons/account/test/account_report.yml.
Traceback (most recent call last):
  File "/var/local/software/openerp-v6.0dev/server/bin/tools/yaml_import.py", line 410, in process_python
    unsafe_eval(code_obj, {'ref': self.get_id}, code_context)
  File "/var/local/software/openerp-v6.0dev/server/bin/addons/account/test/account_report.yml", line 2, in <module>
    In order to test the PDF reports defined on an invoice, we will create a Invoice Record
  File "/var/local/software/openerp-v6.0dev/server/bin/report/report_sxw.py", line 405, in create
    fnct_ret = fnct(cr, uid, ids, data, report_xml, context)
  File "/var/local/software/openerp-v6.0dev/server/bin/report/report_sxw.py", line 439, in create_source_pdf
    result = self.create_single_pdf(cr, uid, [obj.id], data, report_xml, context)
  File "/var/local/software/openerp-v6.0dev/server/bin/report/report_sxw.py", line 490, in create_single_pdf
    pdf = create_doc(etree.tostring(processed_rml),rml_parser.localcontext,logo,title.encode('utf8'))
  File "/var/local/software/openerp-v6.0dev/server/bin/report/interface.py", line 190, in create_pdf
    obj.render()
  File "/var/local/software/openerp-v6.0dev/server/bin/report/render/render.py", line 49, in render
    result = self._render()
  File "/var/local/software/openerp-v6.0dev/server/bin/report/render/rml.py", line 42, in _render
    return rml2pdf.parseNode(self.rml, self.localcontext, images=self.bin_datas, path=self.path,title=self.title)
  File "/var/local/software/openerp-v6.0dev/server/bin/addons/base_report_unicode/__init__.py", line 80, in convert2TrueType
    return method(data, args[1:] if len(args) > 2 else args[1], **argv)
  File "/var/local/software/openerp-v6.0dev/server/bin/report/render/rml2pdf/trml2pdf.py", line 931, in parseNode
    r.render(fp)
  File "/var/local/software/openerp-v6.0dev/server/bin/report/render/rml2pdf/trml2pdf.py", line 279, in render
    pt_obj.render(el)
  File "/var/local/software/openerp-v6.0dev/server/bin/report/render/rml2pdf/trml2pdf.py", line 915, in render
    self.doc_tmpl.build(fis)
  File "/usr/lib/python2.6/dist-packages/reportlab/platypus/doctemplate.py", line 903, in build
   self._endBuild()
  File "/usr/lib/python2.6/dist-packages/reportlab/platypus/doctemplate.py", line 845, in _endBuild
    if getattr(self,'_doSave',1): self.canv.save()
  File "/usr/lib/python2.6/dist-packages/reportlab/pdfgen/canvas.py", line 1091, in save
    self._doc.SaveToFile(self._filename, self)
  File "/usr/lib/python2.6/dist-packages/reportlab/pdfbase/pdfdoc.py", line 235, in SaveToFile
    f.write(self.GetPDFData(canvas))
  File "/usr/lib/python2.6/dist-packages/reportlab/pdfbase/pdfdoc.py", line 247, in GetPDFData
    fnt.addObjects(self)
  File "/usr/lib/python2.6/dist-packages/reportlab/pdfbase/ttfonts.py", line 1121, in addObjects
    pdfFont.ToUnicode = doc.Reference(cmapStream, 'toUnicodeCMap:' + baseFontName)
  File "/usr/lib/python2.6/dist-packages/reportlab/pdfbase/pdfdoc.py", line 507, in Reference
     raise ValueError, "redefining named object: "+repr(name)
ValueError: redefining named object: 'toUnicodeCMap:AAAAAA+DejaVuSans'
[2010-11-29 13:00:09,199][dev60] ERROR:tests.account:redefining named object: 'toUnicodeCMap:AAAAAA+DejaVuSans'
Traceback (most recent call last):
  File "/var/local/software/openerp-v6.0dev/server/bin/tools/yaml_import.py", line 721, in process
    self._process_node(node)
  File "/var/local/software/openerp-v6.0dev/server/bin/tools/yaml_import.py", line 736, in _process_node
    self.process_python(node)
  File "/var/local/software/openerp-v6.0dev/server/bin/tools/yaml_import.py", line 410, in process_python
    unsafe_eval(code_obj, {'ref': self.get_id}, code_context)
  File "/var/local/software/openerp-v6.0dev/server/bin/addons/account/test/account_report.yml", line 2, in <module>
    In order to test the PDF reports defined on an invoice, we will create a Invoice Record
  File "/var/local/software/openerp-v6.0dev/server/bin/report/report_sxw.py", line 405, in create
    fnct_ret = fnct(cr, uid, ids, data, report_xml, context)
  File "/var/local/software/openerp-v6.0dev/server/bin/report/report_sxw.py", line 439, in create_source_pdf
    result = self.create_single_pdf(cr, uid, [obj.id], data, report_xml, context)
  File "/var/local/software/openerp-v6.0dev/server/bin/report/report_sxw.py", line 490, in create_single_pdf
    pdf = create_doc(etree.tostring(processed_rml),rml_parser.localcontext,logo,title.encode('utf8'))
  File "/var/local/software/openerp-v6.0dev/server/bin/report/interface.py", line 190, in create_pdf
    obj.render()
  File "/var/local/software/openerp-v6.0dev/server/bin/report/render/render.py", line 49, in render
    result = self._render()
  File "/var/local/software/openerp-v6.0dev/server/bin/report/render/rml.py", line 42, in _render
    return rml2pdf.parseNode(self.rml, self.localcontext, images=self.bin_datas, path=self.path,title=self.title)
  File "/var/local/software/openerp-v6.0dev/server/bin/addons/base_report_unicode/__init__.py", line 80, in convert2TrueType
    return method(data, args[1:] if len(args) > 2 else args[1], **argv)
  File "/var/local/software/openerp-v6.0dev/server/bin/report/render/rml2pdf/trml2pdf.py", line 931, in parseNode
    r.render(fp)
  File "/var/local/software/openerp-v6.0dev/server/bin/report/render/rml2pdf/trml2pdf.py", line 279, in render
    pt_obj.render(el)
  File "/var/local/software/openerp-v6.0dev/server/bin/report/render/rml2pdf/trml2pdf.py", line 915, in render
    self.doc_tmpl.build(fis)
  File "/usr/lib/python2.6/dist-packages/reportlab/platypus/doctemplate.py", line 903, in build
    self._endBuild()
  File "/usr/lib/python2.6/dist-packages/reportlab/platypus/doctemplate.py", line 845, in _endBuild
    if getattr(self,'_doSave',1): self.canv.save()
  File "/usr/lib/python2.6/dist-packages/reportlab/pdfgen/canvas.py", line 1091, in save
    self._doc.SaveToFile(self._filename, self)
  File "/usr/lib/python2.6/dist-packages/reportlab/pdfbase/pdfdoc.py", line 235, in SaveToFile
    f.write(self.GetPDFData(canvas))
  File "/usr/lib/python2.6/dist-packages/reportlab/pdfbase/pdfdoc.py", line 247, in GetPDFData
    fnt.addObjects(self)
  File "/usr/lib/python2.6/dist-packages/reportlab/pdfbase/ttfonts.py", line 1121, in addObjects
    pdfFont.ToUnicode = doc.Reference(cmapStream, 'toUnicodeCMap:' + baseFontName)
  File "/usr/lib/python2.6/dist-packages/reportlab/pdfbase/pdfdoc.py", line 507, in Reference
    raise ValueError, "redefining named object: "+repr(name)
ValueError: redefining named object: 'toUnicodeCMap:AAAAAA+DejaVuSans'
[2010-11-29 13:00:09,200][dev60] TEST:ERROR:redefining named object: 'toUnicodeCMap:AAAAAA+DejaVuSans'
[2010-11-29 13:00:09,552][dev60] INFO:i18n:module account: loading translation file for language vi
[2010-11-29 13:00:09,552][dev60] INFO:i18n:loading /var/local/software/openerp-v6.0dev/server/bin/addons/account/i18n/vi.po





References