我从下面的 odoo 文档的官方链接中获得了这些信息:
repeatIn(list, varname[, tagname]) :为列表中的每个对象重复模板的当前部分(整个文档、当前部分、表中的当前行)。在模板的标签中使用 varname。从 4.1.X 版本开始,您可以使用可选的第三个参数,即要循环的 .RML 标记的名称。
https://doc.odoo.com/v6.0/developer/3_11_reports/11_1_openoffice_report.html
我想知道如何使用这个重复,因为我已经这样尝试过:
<para style="P7">[[ repeatIn(get_employee_lines((example.company_id,example.date_start,example. date_end), o[,td]) ]]</para>
<para style="P7">[[ o['name'] ]]</para>
我有这个错误:
2015-09-02 11:37:00,027 8110 ERROR openerp openerp.tools.safe_eval: Cannot eval
'repeatIn(get_employee_lines((example.company_id,example.date_start,example.date_end), o[,td])'
Traceback (most recent call last):
File "/opt/openerp/v7/server/openerp/tools/safe_eval.py", line 288, in safe_eval
return eval(test_expr(expr, _SAFE_OPCODES, mode=mode), globals_dict, locals_dict)
File "/opt/openerp/v7/server/openerp/tools/safe_eval.py", line 162, in test_expr
code_obj = compile(expr, "", mode)
File "<string>", line 1
repeatIn(get_employee_lines((example.company_id,example.date_start,example.date_end), o[,td])
^
SyntaxError: invalid syntax
2015-09-02 11:37:00,027 8110 ERROR openerp openerp.tools.safe_eval: Cannot eval "o['name']"
Traceback (most recent call last):
File "/opt/openerp/v7/server/openerp/tools/safe_eval.py", line 288, in safe_eval
return eval(test_expr(expr, _SAFE_OPCODES, mode=mode), globals_dict, locals_dict)
File "", line 1, in <module>
NameError: name 'o' is not defined
请问谁能解决这个问题。问候。