请使用rml在OpenERP中创建新报告。 所以我在我的rml中使用这个代码为每个结果创建一个新的td,但问题是我得到了Exception:' NoneType'对象没有属性'标记'作为一个错误。 这是我的代码:
<tr>
<para style="P7">[[ repeatIn(get_employee_lines(), 'o', 'td') ]]</para>
<td>
<para style="P9">NOM EMPLOYÉ</para>
</td>
<td>
<para style="P7">[[ o['name'] ]]</para>
</td>
</tr>
那么,请谁能帮我找到解决方案真的需要帮助。 这是所有的错误:
2015-09-01 10:21:45,562 6030 ERROR openerp openerp.service.web_services: Exception: 'NoneType' object has no attribute 'tag'
Traceback (most recent call last):
File "/opt/openerp/v7/server/openerp/service/web_services.py", line 712, in go
(result, format) = obj.create(cr, uid, ids, datas, context)
File "/opt/openerp/v7/server/openerp/report/report_sxw.py", line 443, in create
fnct_ret = fnct(cr, uid, ids, data, report_xml, context)
File "/opt/openerp/v7/server/openerp/report/report_sxw.py", line 512, in create_source_pdf
return self.create_single_pdf(cr, uid, ids, data, report_xml, context)
File "/opt/openerp/v7/server/openerp/report/report_sxw.py", line 530, in create_single_pdf
processed_rml = self.preprocess_rml(processed_rml,report_xml.report_type)
File "/opt/openerp/v7/server/openerp/report/preprocess.py", line 82, in preprocess_rml
self.preprocess_rml(node,type)
File "/opt/openerp/v7/server/openerp/report/preprocess.py", line 82, in preprocess_rml
self.preprocess_rml(node,type)
File "/opt/openerp/v7/server/openerp/report/preprocess.py", line 82, in preprocess_rml
self.preprocess_rml(node,type)
File "/opt/openerp/v7/server/openerp/report/preprocess.py", line 77, in preprocess_rml
t = _regex1.sub(_sub1, node.text or node.tail)
File "/opt/openerp/v7/server/openerp/report/preprocess.py", line 73, in _sub1
while n.tag not in match:
AttributeError: 'NoneType' object has no attribute 'tag'
2015-09-01 10:21:45,793 6030 ERROR openerp openerp.netsvc: 'NoneType' object has no attribute 'tag'
(<type 'exceptions.AttributeError'>, AttributeError("'NoneType' object has no attribute 'tag'",), <traceback object at 0x7fdea5a5c950>)
Traceback (most recent call last):
File "/opt/openerp/v7/server/openerp/netsvc.py", line 296, in dispatch_rpc
result = ExportService.getService(service_name).dispatch(method, params)
File "/opt/openerp/v7/server/openerp/service/web_services.py", line 654, in dispatch
res = fn(db, uid, *params)
File "/opt/openerp/v7/server/openerp/service/web_services.py", line 760, in exp_report_get
return self._check_report(report_id)
File "/opt/openerp/v7/server/openerp/service/web_services.py", line 738, in _check_report
netsvc.abort_response(exc, exc.message, 'warning', exc.traceback)
File "/opt/openerp/v7/server/openerp/netsvc.py", line 71, in abort_response
raise openerp.osv.osv.except_osv(description, details)
except_osv: (u"'NoneType' object has no attribute 'tag'", (<type 'exceptions.AttributeError'>, AttributeError("'NoneType' object has no attribute 'tag'",), <traceback object at 0x7fdea5a5c950>))
答案 0 :(得分:0)
这是答案。
首先,我必须更改我的OpenOffice的版本,即v4.1.X。
其次,我使用了[[repeatIn(get_employee_lines(example.company_id,example.date_start,example.date_end),&#39; o&#39;,&#39; td&#39;)]]并为每一行创建一个新的表格单元格。 所以这是正确的答案:
<tr>
<td>
<para style="P8">NOM EMPLOYÉ</para>
</td>
<td>
<para style="P7">[[ repeatIn(get_employee_lines(example.company_id,example.date_start,example.d ate_end), 'o', 'td') ]]</para>
<para style="P7">[[ o['name'] ]]</para>
</td>
</tr>
最诚挚的问候。