Please i am using rml to create a new report in OpenERP. So that i use in my rml this code to create for each result a new td but the problem is that i got Exception: 'NoneType' object has no attribute 'tag' as an error. Here is my code:
in python:
def gross_wage_line(self, salary_line_ids) :
list=[ ]
for line in salary_line_ids :
if line.type == 'brute' and line.afficher:
if line.deductible:
gain=0
retenu=float(line.subtotal_employee)
else:
gain=float(line.subtotal_employee)
retenu=0
dict={'name' : line.name,
'base' : line.base,
'rate_employee' : float(line.rate_employee),
'gain' : gain,
'retenu': retenu,
}
list.append(dict)
return list
In RML:
<section>
<para style="P1">[[ repeatIn(gross_wage_line(s.salary_line_ids),'line') ]]</para>
<blockTable colWidths="206.0,53.0,41.0,38.0,47.0,42.0,55.0" style="Table6">
<tr>
<td>
<para style="P22">[[ line['name'] ]]</para>
</td>
<td>
<para style="P24">[[ str(line['base']) ]]</para>
</td>
<td>
<para style="P13">[[ line['rate_employee'] ]]</para>
</td>
<td>
<para style="P24">[[ line['gain'] or '']]</para>
</td>
<td>
<para style="P24">[[ line['retenu'] or '' ]]</para>
</td>
<td>
<para style="P20">
<font color="white"> </font>
</para>
</td>
<td>
<para style="P20">
<font color="white"> </font>
</para>
</td>
</tr>
</blockTable>
</section>
l'error is :
"name 'gross_wage_line' is not defined" while evaluating"repeatIn(gross_wage_line(s.salary_line_ids),'line')"<type 'exceptions.ValueError'>,"name 'gross_wage_line' is not defined" while evaluating"repeatIn(gross_wage_line(s.salary_line_ids),'line')",<traceback object at 0x7f8186722320>
Can someone help me