Error unsupported operand type(s) for +: 'int' and 'datetime.timedelta'

64 Views Asked by At

I want to generate a printout

and one of the fields that i want to display is the sum of the duration on the printout, I have called the duration of each line then i have applied the sum directly to those lines and Here is the code:

PS: I have a timesheet model and the lines as a one2many field table-relation

  <text:p text:style-name="P31"><text:placeholder text:placeholder-type="text">&lt;format_duration(sum(line.duration for line in timesheet.lines))&gt;</text:placeholder></text:p>

But there was an error tell me:

  File "<string>", line 480, in <Expression '__relatorio_guess_type(__relatorio_store_cache(140239131800968, format_duration(sum(line.duration for line in timesheet.lines))))'>
TypeError: unsupported operand type(s) for +: 'int' and 'datetime.timedelta'
0

There are 0 best solutions below