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

原论坛用户的基本信息和发帖这里都予以保留,请注意:原论坛用户无需重新注册新用户,但是您的密码需要重置

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

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

开发打印报表断点进入不了



  • 做了一个凭证打印的rml
    xml内容
    [code] <report
                auto="True"
                id="account_move_print"
                model="account.move"
                name="account_print"
                header="False"
                multi="True"
                rml="account_move_print/report/account_move_print.rml"
                string="Journal Print"/>[/code]
    py文件内容
    [code]class move_print(report_sxw.rml_parse):
        def init(self, cr, uid, name, context):
            super(move_print, self).init(cr, uid, name, context)
            self.localcontext.update({
                'time': time,    #断点位置
                'lst': self._lst,
            })
        def _lst(self, move_id):
            res = []
            .....
            return res
    report_sxw.report_sxw('report.account_move','account.move','addons/account_move_print/report/account_move_print.rml',parser=move_print,header='internal')
    [/code]
    可以正常打印但是使用lst就报没有定义,而且调试的时候断点也进入不去init里面.请问各位大侠是什么问题?



  • 做了一个凭证打印的rml
    xml内容
    [code] <report
                auto="True"
                id="account_move_print"
                model="account.move"
                name="account_print"
                header="False"
                multi="True"
                rml="account_move_print/report/account_move_print.rml"
                string="Journal Print"/>[/code]
    py文件内容
    [code]class move_print(report_sxw.rml_parse):
        def init(self, cr, uid, name, context):
            super(move_print, self).init(cr, uid, name, context)
            self.localcontext.update({
                'time': time,    #断点位置
                'lst': self._lst,
            })
        def _lst(self, move_id):
            res = []
            .....
            return res
    report_sxw.report_sxw('report.account_move','account.move','addons/account_move_print/report/account_move_print.rml',parser=move_print,header='internal')
    [/code]
    可以正常打印但是使用lst就报没有定义,而且调试的时候断点也进入不去init里面.请问各位大侠是什么问题?



  • [quote author=chengwenge link=topic=765.msg3408#msg3408 date=1262158449]
    我的报表已经设计好,在window下运行都没有问题,但是部署到linux下就出错。
    我使用的是 base_report_cn来实现中文的,请知道解决办法的兄弟姐妹们帮忙,急急急。

    Traceback (most recent call last):
      File "/home/chengwenge/bin/5.0.6/openerp-server-5.0.6/bin/service/web_services.py", line 687, in go
        (result, format) = obj.create(cr, uid, ids, datas, context)
      File "/home/chengwenge/bin/5.0.6/openerp-server-5.0.6/bin/report/report_sxw.py", line 364, in create
        return fnct(cr, uid, ids, data, report_xml, context)
      File "/home/chengwenge/bin/5.0.6/openerp-server-5.0.6/bin/report/report_sxw.py", line 421, in create_source_pdf
        return self.create_single_pdf(cr, uid, ids, data, report_xml, context)
      File "/home/chengwenge/bin/5.0.6/openerp-server-5.0.6/bin/report/report_sxw.py", line 439, in create_single_pdf
        pdf = create_doc(etree.tostring(processed_rml),rml_parser.localcontext,logo,title.encode('utf8'))
      File "/home/chengwenge/bin/5.0.6/openerp-server-5.0.6/bin/report/interface.py", line 199, in create_pdf
        obj.render()
      File "/home/chengwenge/bin/5.0.6/openerp-server-5.0.6/bin/report/render/render.py", line 50, in render
        result = self._render()
      File "/home/chengwenge/bin/5.0.6/openerp-server-5.0.6/bin/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 "/home/chengwenge/bin/5.0.6/openerp-server-5.0.6/bin/addons/base_report_cn/init.py", line 86, in convert2TrueType
        return method(data, myargs, **argv)
      File "/home/chengwenge/bin/5.0.6/openerp-server-5.0.6/bin/report/render/rml2pdf/trml2pdf.py", line 780, in parseNode
        r.render(fp)
      File "/home/chengwenge/bin/5.0.6/openerp-server-5.0.6/bin/report/render/rml2pdf/trml2pdf.py", line 195, in render
        pt_obj.render(el)
      File "/home/chengwenge/bin/5.0.6/openerp-server-5.0.6/bin/report/render/rml2pdf/trml2pdf.py", line 770, in render
        fis += r.render(node_story)
      File "/home/chengwenge/bin/5.0.6/openerp-server-5.0.6/bin/report/render/rml2pdf/trml2pdf.py", line 700, in render
        return process_story(node_story)
      File "/home/chengwenge/bin/5.0.6/openerp-server-5.0.6/bin/report/render/rml2pdf/trml2pdf.py", line 693, in process_story
        flow = self._flowable(node)
      File "/home/chengwenge/bin/5.0.6/openerp-server-5.0.6/bin/report/render/rml2pdf/trml2pdf.py", line 607, in _flowable
        return  self._table(node)
      File "/home/chengwenge/bin/5.0.6/openerp-server-5.0.6/bin/report/render/rml2pdf/trml2pdf.py", line 525, in _table
        assert length == len(node.get('colWidths').split(','))
    AssertionError
    [/quote]

    [quote author=hyk249933033 link=topic=16465.msg28316#msg28316 date=1403852888]
    做了一个凭证打印的rml
    xml内容
    [code] <report
                auto="True"
                id="account_move_print"
                model="account.move"
                name="account_print"
                header="False"
                multi="True"
                rml="account_move_print/report/account_move_print.rml"
                string="Journal Print"/>[/code]
    py文件内容
    [code]class move_print(report_sxw.rml_parse):
        def init(self, cr, uid, name, context):
            super(move_print, self).init(cr, uid, name, context)
            self.localcontext.update({
                'time': time,    #断点位置
                'lst': self._lst,
            })
        def _lst(self, move_id):
            res = []
            .....
            return res
    report_sxw.report_sxw('report.account_move','account.move','addons/account_move_print/report/account_move_print.rml',parser=move_print,header='internal')
    [/code]
    可以正常打印但是使用lst就报没有定义,而且调试的时候断点也进入不去init里面.请问各位大侠是什么问题?
    [/quote]


登录后回复
 

与 Odoo 中文社区 的连接断开,我们正在尝试重连,请耐心等待