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

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

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

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

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



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



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



  • [quote author=chengwenge link=topic=765.msg3408#msg3408 date=1262158449]<br />我的报表已经设计好,在window下运行都没有问题,但是部署到linux下就出错。<br />我使用的是 base_report_cn来实现中文的,请知道解决办法的兄弟姐妹们帮忙,急急急。<br /><br />Traceback (most recent call last):<br />  File "/home/chengwenge/bin/5.0.6/openerp-server-5.0.6/bin/service/web_services.py", line 687, in go<br />    (result, format) = obj.create(cr, uid, ids, datas, context)<br />  File "/home/chengwenge/bin/5.0.6/openerp-server-5.0.6/bin/report/report_sxw.py", line 364, in create<br />    return fnct(cr, uid, ids, data, report_xml, context)<br />  File "/home/chengwenge/bin/5.0.6/openerp-server-5.0.6/bin/report/report_sxw.py", line 421, in create_source_pdf<br />    return self.create_single_pdf(cr, uid, ids, data, report_xml, context)<br />  File "/home/chengwenge/bin/5.0.6/openerp-server-5.0.6/bin/report/report_sxw.py", line 439, in create_single_pdf<br />    pdf = create_doc(etree.tostring(processed_rml),rml_parser.localcontext,logo,title.encode('utf8'))<br />  File "/home/chengwenge/bin/5.0.6/openerp-server-5.0.6/bin/report/interface.py", line 199, in create_pdf<br />    obj.render()<br />  File "/home/chengwenge/bin/5.0.6/openerp-server-5.0.6/bin/report/render/render.py", line 50, in render<br />    result = self._render()<br />  File "/home/chengwenge/bin/5.0.6/openerp-server-5.0.6/bin/report/render/rml.py", line 41, in _render<br />    return rml2pdf.parseNode(self.rml, self.localcontext, images=self.bin_datas, path=self.path,title=self.title)<br />  File "/home/chengwenge/bin/5.0.6/openerp-server-5.0.6/bin/addons/base_report_cn/init.py", line 86, in convert2TrueType<br />    return method(data, myargs, **argv)<br />  File "/home/chengwenge/bin/5.0.6/openerp-server-5.0.6/bin/report/render/rml2pdf/trml2pdf.py", line 780, in parseNode<br />    r.render(fp)<br />  File "/home/chengwenge/bin/5.0.6/openerp-server-5.0.6/bin/report/render/rml2pdf/trml2pdf.py", line 195, in render<br />    pt_obj.render(el)<br />  File "/home/chengwenge/bin/5.0.6/openerp-server-5.0.6/bin/report/render/rml2pdf/trml2pdf.py", line 770, in render<br />    fis += r.render(node_story)<br />  File "/home/chengwenge/bin/5.0.6/openerp-server-5.0.6/bin/report/render/rml2pdf/trml2pdf.py", line 700, in render<br />    return process_story(node_story)<br />  File "/home/chengwenge/bin/5.0.6/openerp-server-5.0.6/bin/report/render/rml2pdf/trml2pdf.py", line 693, in process_story<br />    flow = self._flowable(node)<br />  File "/home/chengwenge/bin/5.0.6/openerp-server-5.0.6/bin/report/render/rml2pdf/trml2pdf.py", line 607, in _flowable<br />    return  self._table(node)<br />  File "/home/chengwenge/bin/5.0.6/openerp-server-5.0.6/bin/report/render/rml2pdf/trml2pdf.py", line 525, in _table<br />    assert length == len(node.get('colWidths').split(','))<br />AssertionError<br />[/quote]<br /><br />[quote author=hyk249933033 link=topic=16465.msg28316#msg28316 date=1403852888]<br />做了一个凭证打印的rml<br />xml内容<br />[code] <report <br />            auto="True" <br />            id="account_move_print" <br />            model="account.move" <br />            name="account_print" <br />            header="False"<br />            multi="True"<br />            rml="account_move_print/report/account_move_print.rml" <br />            string="Journal Print"/>[/code]<br />py文件内容<br />[code]class move_print(report_sxw.rml_parse):<br />    def init(self, cr, uid, name, context):<br />        super(move_print, self).init(cr, uid, name, context)<br />        self.localcontext.update({<br />            'time': time,    #断点位置<br />            'lst': self._lst,<br />        })<br />    def _lst(self, move_id):<br />        res = []<br />        .....<br />        return res<br />report_sxw.report_sxw('report.account_move','account.move','addons/account_move_print/report/account_move_print.rml',parser=move_print,header='internal')<br />[/code]<br />可以正常打印但是使用lst就报没有定义,而且调试的时候断点也进入不去init里面.请问各位大侠是什么问题?<br />[/quote]


登录后回复
 

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