Odoo Help


Exception: 'NoneType' object has no attribute 'tag' RepeatIn

on 4/11/16, 5:43 AM 779 views

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:






               dict={'name' : line.name,

                          'base' : line.base,

                          'rate_employee' : float(line.rate_employee),

                          'gain' : gain,

                          'retenu': retenu,



            return list



<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">



<para style="P22">[[ line['name'] ]]</para>



<para style="P24">[[ str(line['base']) ]]</para>



<para style="P13">[[ line['rate_employee'] ]]</para>



<para style="P24">[[ line['gain'] or '']]</para>



<para style="P24">[[ line['retenu'] or '' ]]</para>



<para style="P20">

<font color="white"> </font>




<para style="P20">

<font color="white"> </font>






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

Axel Mendoza
On 4/11/16, 9:35 AM

That python function should be defined in a report parser so after everything is correct and the parser is used that error will vanish. I personally recommends you to switch to QWEB based reports instead of use RML ones.

Here you can see how to define parsers (https://www.odoo.com/es_ES/forum/ayuda-1/question/how-to-define-a-custom-methods-functions-to-be-used-in-a-qweb-report-how-to-define-and-use-a-report-parser-92244), without the last report Transient model (for QWEB) you could finish your parser registration using something like this complete example:

import time

from openerp.report import report_sxw

class annual_parser(report_sxw.rml_parse):

def _get_calendar(self, string):

if string:

return string.replace("\n", ", ")

return ""

def __init__(self, cr, uid, name, context=None):

super(annual_parser, self).__init__(cr, uid, name, context=context)


'time': time,

'_get_calendar': self._get_calendar


report_sxw.report_sxw('report.Annual_Maintenance_Plan', 'solt.maintenance.plan', 'solt_maintenance_plan/report/solt_maintenance_plan_annual_report.rml', parser=annual_parser, header="False")

About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

1 follower(s)


Asked: 4/11/16, 5:43 AM
Seen: 779 times
Last updated: 4/11/16, 9:35 AM