TypeError: 'in <string>' requires string as left operand, not NoneType - - -

Viewed 39

I'm getting an error with the following:

Traceback (most recent call last):
return cls._handle_exception(e)
File "/opt/odoo12/odoo/addons/website/models/ir_http.py", line 285, in _handle_exception
if exception.html in view.arch:
TypeError: 'in ' requires string as left operand, not NoneType - - -

This is my python file (report_xlsx module in odoo):

from odoo import models


class DailyTasksXLS(models.AbstractModel):
    _name = 'report.hr_daily_task.report_daily_task_xls'
    _inherit = 'report.report_xlsx.abstract'

    def generate_xlsx_report(self, workbook, data, lines):
        format2 = workbook.add_format({'font_size': 12, 'align': 'vcenter', })
        for line in lines.work_ids:
            sheet.write(l, 0, line.name, format2)
            sheet.write(l, 1, line.description, format2)
            sheet.write(l, 2, line.unit_amount, format2)
            l = l+1
            total_hours = total_hours + line.unit_amount
            total_col = l

How to solve this?

0 Answers
Related