Developer23
Developer23

Reputation: 63

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

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'

Upvotes: 0

Views: 65

Answers (0)

Related Questions