我的场景是,按照开始时间和结束时间,到考勤的记录表、以及员工表、部门表中查询出相应的考勤记录、部门、姓名等字段,然后在代码中做一些计算, 最后显示到tree视图中,请教下,这个改如何实现? odoo新手,望解答。
wanghaoinfo
-
Odoo多表查询实现 -
开发打印报表断点进入不了[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内容<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"/>
py文件内容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 />
可以正常打印但是使用lst就报没有定义,而且调试的时候断点也进入不去init里面.请问各位大侠是什么问题?
[/quote]