Odoo 中文社区

    • Register
    • Login
    • Search
    • Categories
    • Tags
    • Popular
    • Users
    • Groups

    Odoo中文社区可以通过以下两个域名访问:shine-it.net , odoo.net.cn

    由于系统升迁的原因,本论坛部分较早期的内容存在格式和链接损坏失效的问题,并非本论坛系统本身的缺陷,望谅解

    本社区没有维护任何QQ群讨论组,任何与本社区同名的QQ群讨论组的言论与本社区无关!

    开发人员可以登录gitter讨论组: http://gitter.im/odoo-china/Talk, 需要github账号

    如果您登录系统碰到问题,请在微信公众号留言:

    PDF 报表中文支持模块:base_report_cn

    Odoo 开发与实施交流
    16
    37
    48030
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • O
      oldrev last edited by

      此模块是基于 Gábor Dukai 编写的 base_report_unicode 模块修改而来,自带了开源的文泉驿正黑体和 AR PL SungtiL GB 宋体。该模块的使用非常简单,只需要直接导入这个模块,不需要任何的 hack,OpenERP 现存的报表即可直接支持中文。当然了,内置报表的现存的文字仍然是英文的,本模块只是提供中文支持,让中文别显示成方框。

      下载:
      openerp-community-addons.googlecode.com/files/base_report_cn.zip

      项目主页:
      code.google.com/p/openerp-community-addons

      [[i] 本帖最后由 oldrev 于 2009-4-3 22:25 编辑 [/i]]

      1 Reply Last reply Reply Quote 0
      • A
        allen_zj last edited by

        感谢你的消息回复!
        这个模块包我回去导入了试了下,直接导入的时候OpenERP会报错
        [attach]181[/attach]

        后来我试了一下解压缩这个包(会提示复盖,不知道为什么)
        重新打成.zip包后,到OpenERP里导入这个模块,可以成功导入,但打印的时候又提示出错,说找不到TTF这个字体
        [attach]182[/attach]

        然后我就把那个包解压出来,将base_report_cn目录直接复制到serveraddons目录下,再试着打印终于看到熟悉亲切的中文了:) 心情那个激动啊,这个问题拆腾我2天了,网上找了N遍,也试了N种方式,今天终于解决了,非常感谢你的帮忙!!!!!!
        [attach]183[/attach]

        1 Reply Last reply Reply Quote 0
        • digitalsatori
          digitalsatori 管理员 last edited by

          中文pdf输出从此很容易了。非常感谢oldrev的贡献。

          【上海先安科技】(tony AT openerp.cn)

          1 Reply Last reply Reply Quote 0
          • H
            Han last edited by

            Traceback (most recent call last):
            File "/usr/local/lib/python2.5/site-packages/openerp-server/service/web_services.py", line 600, in go
            (result, format) = obj.create(cr, uid, ids, datas, context)
            File "/usr/local/lib/python2.5/site-packages/openerp-server/report/report_sxw.py", line 645, in create
            return self.create_single(cr, uid, ids, data, report_xml, context)
            File "/usr/local/lib/python2.5/site-packages/openerp-server/report/report_sxw.py", line 733, in create_single
            pdf = create_doc(rml2, logo, title.encode('utf8'))
            File "/usr/local/lib/python2.5/site-packages/openerp-server/report/interface.py", line 199, in create_pdf
            obj.render()
            File "/usr/local/lib/python2.5/site-packages/openerp-server/report/render/render.py", line 50, in render
            result = self._render()
            File "/usr/local/lib/python2.5/site-packages/openerp-server/report/render/rml.py", line 36, in _render
            return rml2pdf.parseString(self.xml, images=self.bin_datas, path=self.path,title=self.title)
            File "/usr/local/lib/python2.5/site-packages/openerp-server/addons/base_report_cn/init.py", line 79, in convert2TrueType
            data = data.replace(old, new)
            File "/usr/local/lib/python2.5/site-packages/openerp-server/report/render/rml2pdf/trml2pdf.py", line 803, in parseString
            r.render(fp)
            File "/usr/local/lib/python2.5/site-packages/openerp-server/report/render/rml2pdf/trml2pdf.py", line 214, in render
            self.docinit(el)
            File "/usr/local/lib/python2.5/site-packages/openerp-server/report/render/rml2pdf/trml2pdf.py", line 191, in docinit
            pdfmetrics.registerFont(TTFont(name, fname ))
            File "/usr/local/lib/python2.5/site-packages/reportlab/pdfbase/ttfonts.py", line 960, in init
            canvas.drawString(x, y, "Some text encoded in UTF-8")
            File "/usr/local/lib/python2.5/site-packages/reportlab/pdfbase/ttfonts.py", line 875, in init
            return output.makeStream()
            File "/usr/local/lib/python2.5/site-packages/reportlab/pdfbase/ttfonts.py", line 398, in init
            return stm.getvalue()
            File "/usr/local/lib/python2.5/site-packages/reportlab/pdfbase/ttfonts.py", line 463, in extractInfo
            self.seek(string_data_offset + offset)
            TTFError: Could not find PostScript font name

            1 Reply Last reply Reply Quote 0
            • H
              Han last edited by

              系统在freebsd7.1下

              1 Reply Last reply Reply Quote 0
              • H
                Han last edited by

                openERP 5.0.0.3

                1 Reply Last reply Reply Quote 0
                • digitalsatori
                  digitalsatori 管理员 last edited by

                  [quote]Could not find PostScript font name[/quote]

                  报表中使用了系统中不存在的字体?

                  【上海先安科技】(tony AT openerp.cn)

                  1 Reply Last reply Reply Quote 0
                  • H
                    Han last edited by

                    重新启动了一下openerp-server 居然就没错误了,有这个道理么?

                    1 Reply Last reply Reply Quote 0
                    • S
                      simon last edited by

                      在5.0.1-0下没作用

                      1 Reply Last reply Reply Quote 0
                      • I
                        iplan last edited by

                        是哦,在5.0.1-0下没作用
                        我装的是centos-5.3系统

                        1 Reply Last reply Reply Quote 0
                        • I
                          iplan last edited by

                          适用5.0.1-0的base_report_cn已经提交到svn,
                          如果你使用的是以前版本的openerp系统
                          请check out之前的版本

                          1 Reply Last reply Reply Quote 0
                          • S
                            simon last edited by

                            我来串门的5。0.1的报表修改,用附件的文件代替解压目录下同名的文件就可以 [attach]195[/attach]

                            1 Reply Last reply Reply Quote 0
                            • S
                              sagas last edited by

                              我使用产品的“product cost structure”,打印出来的文档标题倒是支持中文了,但是各BOM项还是方块的。奇怪的是这个模块安装之后不能卸载。

                              [[i] 本帖最后由 sagas 于 2009-6-20 17:52 编辑 [/i]]

                              1 Reply Last reply Reply Quote 0
                              • D
                                dquo last edited by

                                为什么我的显示还是方格呢,郁闷高手们帮忙了~~

                                1 Reply Last reply Reply Quote 0
                                • D
                                  dquo last edited by

                                  忘了说了我的是5.0.1

                                  1 Reply Last reply Reply Quote 0
                                  • I
                                    iplan last edited by

                                    [quote]原帖由 [i]sagas[/i] 于 2009-6-20 17:50 发表 shine-it.net/tinyerp/redirect.php?goto=findpost&pid=2326&ptid=447
                                    我使用产品的“product cost structure”,打印出来的文档标题倒是支持中文了,但是各BOM项还是方块的。奇怪的是这个模块安装之后不能卸载。 [/quote]

                                    这个不是报表模块的原因
                                    是因为这个报表是xsl报表,在xsl没有定义表头和明细的字体名字,标题定义了所以能显示中文

                                    1 Reply Last reply Reply Quote 0
                                    • S
                                      sagas last edited by

                                      改掉了也许是因为源代码的一处低级错误。

                                      1 Reply Last reply Reply Quote 0
                                      • I
                                        iplan last edited by

                                        [quote]原帖由 [i]sagas[/i] 于 2009-6-23 21:51 发表 shine-it.net/tinyerp/redirect.php?goto=findpost&pid=2402&ptid=447
                                        改掉了也许是因为源代码的一处低级错误。 [/quote]

                                        慎重....
                                        这样改其他报表可能会报错

                                        1 Reply Last reply Reply Quote 0
                                        • I
                                          intoasp last edited by

                                          我可以导入 报表中文 模块, 导入正常,但是 貌似没有起作用。。 销售订单里边 中文呢字还是框框的。。

                                          1 Reply Last reply Reply Quote 0
                                          • First post
                                            Last post